Where in Bitcoin Core does it do X?Ubuntu bitcoin PPABitcoin core does not have all unconfirmed transactionsWhat versioning scheme does Bitcoin Core follow?Migration from Berkeley DB to LevelDBWhere does the Bitcoin Core code serialize the number of transactions?Merkle Root and Merkle ProofsWhat are the exact steps for creating a transaction and having a valid block?Where can one find the Bitcoin core roadmap?Do bitcoind and bitcoin-qt resume blockchain downloading from the same place?Exception CompactSize when I parsering a nuimbar od the blk file >= 976

Has the Hulk always been able to talk?

Emotional immaturity of comic-book version of superhero Shazam

What does "Managed by Windows" do in the Power options for network connection?

Can my company stop me from working overtime?

Why are UK Bank Holidays on Mondays?

In Stroustrup's example, what does this colon mean in `return 1 : 2`? It's not a label or ternary operator

Why does sound not move through a wall?

Find the cheapest shipping option based on item weight

How to safely wipe a USB flash drive

Why do people keep telling me that I am a bad photographer?

Upside-Down Pyramid Addition...REVERSED!

What was Bran's plan to kill the Night King?

Can I use a fetch land to shuffle my deck while the opponent has Ashiok, Dream Render in play?

Should I decline this job offer that requires relocating to an area with high cost of living?

Something that can be activated/enabled

IP addresses from public IP block in my LAN

Point of the Dothraki's attack in GoT S8E3?

Are Finitely generated modules over a ring also finitely generated over a subring containing the identity?

Can FreeNAS zfs send to a Linux machine?

Are pressure-treated posts that have been submerged for a few days ruined?

How to increase the size of the cursor in Lubuntu 19.04?

List of newcommands used

Causes of bimodal distributions when bootstrapping a meta-analysis model

Decoupling cap routing on a 4 layer PCB



Where in Bitcoin Core does it do X?


Ubuntu bitcoin PPABitcoin core does not have all unconfirmed transactionsWhat versioning scheme does Bitcoin Core follow?Migration from Berkeley DB to LevelDBWhere does the Bitcoin Core code serialize the number of transactions?Merkle Root and Merkle ProofsWhat are the exact steps for creating a transaction and having a valid block?Where can one find the Bitcoin core roadmap?Do bitcoind and bitcoin-qt resume blockchain downloading from the same place?Exception CompactSize when I parsering a nuimbar od the blk file >= 976













3















Note that this is a general question and answer designed to serve as a guide for finding things in Bitcoin Core.




Where in Bitcoin Core's source code does it do X? How can I find that code by myself?




Example questions:



  • Where does Bitcoin Core determine if a transaction is valid?

  • Where is the Proof of Work checked?

  • Where is the code for transaction creation?









share|improve this question


























    3















    Note that this is a general question and answer designed to serve as a guide for finding things in Bitcoin Core.




    Where in Bitcoin Core's source code does it do X? How can I find that code by myself?




    Example questions:



    • Where does Bitcoin Core determine if a transaction is valid?

    • Where is the Proof of Work checked?

    • Where is the code for transaction creation?









    share|improve this question
























      3












      3








      3








      Note that this is a general question and answer designed to serve as a guide for finding things in Bitcoin Core.




      Where in Bitcoin Core's source code does it do X? How can I find that code by myself?




      Example questions:



      • Where does Bitcoin Core determine if a transaction is valid?

      • Where is the Proof of Work checked?

      • Where is the code for transaction creation?









      share|improve this question














      Note that this is a general question and answer designed to serve as a guide for finding things in Bitcoin Core.




      Where in Bitcoin Core's source code does it do X? How can I find that code by myself?




      Example questions:



      • Where does Bitcoin Core determine if a transaction is valid?

      • Where is the Proof of Work checked?

      • Where is the code for transaction creation?






      bitcoin-core bitcoincore-development






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      Andrew ChowAndrew Chow

      34.4k42562




      34.4k42562




















          1 Answer
          1






          active

          oldest

          votes


















          3














          Introduction



          The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or transaction is received.



          There are generally three kinds of actions that Bitcoin Core does: validation and relay of blocks and transactions, the wallet, and startup



          Validation and relay



          In order for Bitcoin Core to be able to validate and relay a block or transaction, it has to first receive it. So logically the place to begin looking is at the point where a block or transaction has been received and it is beginning to be processed. That is in ProcessMessages function in src/net_processing.cpp. Within this function, there are several if statements for each type of network message that can be received.



          For transactions, you want to look at the if block for NetMsgType::TX. By reading through the code in this if block and following the functions that are called, you will eventually reach where a transaction is verified, added to the mempool, and relayed. The most important function within this block is AcceptToMemoryPool and that is where all of the validation for an unconfirmed transaction is done.



          For blocks, you want to look at the if block for NetMsgType::BLOCK. Reading through this code will lead you to ProcessNewBlock and later ActivateBestChain and ConnectTip which are the functions that contain the validation of blocks.



          The wallet



          Almost all of the wallet's functionality is centered around the creation and receiving of transactions. These logically begin when the user wants to send Bitcoin. So a good starting place is the sendtoaddress RPC. Following this function will take you to CreateTransaction and later SelectCoins which are responsible for transaction creation and coin selection.



          Some other things that are interesting in the wallet would include wallet creation and loading which occurs in CreateWalletFromFile and wallet encryption and unlocking which have good starting points of the encryptwallet RPC and walletpassphrase RPC



          Startup and initialization



          Lastly some interesting occur during startup such as DNS seeding, connecting to nodes, loading the blockchain from disk, etc. The obvious and actual starting point is the main function. The main function is the entry point for pretty much every C/C++ program so it's a good place to look at for startup. Following the main function will bring you to AppInitMain which is where the bulk of loading and initialization occurs.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "308"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f87450%2fwhere-in-bitcoin-core-does-it-do-x%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Introduction



            The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or transaction is received.



            There are generally three kinds of actions that Bitcoin Core does: validation and relay of blocks and transactions, the wallet, and startup



            Validation and relay



            In order for Bitcoin Core to be able to validate and relay a block or transaction, it has to first receive it. So logically the place to begin looking is at the point where a block or transaction has been received and it is beginning to be processed. That is in ProcessMessages function in src/net_processing.cpp. Within this function, there are several if statements for each type of network message that can be received.



            For transactions, you want to look at the if block for NetMsgType::TX. By reading through the code in this if block and following the functions that are called, you will eventually reach where a transaction is verified, added to the mempool, and relayed. The most important function within this block is AcceptToMemoryPool and that is where all of the validation for an unconfirmed transaction is done.



            For blocks, you want to look at the if block for NetMsgType::BLOCK. Reading through this code will lead you to ProcessNewBlock and later ActivateBestChain and ConnectTip which are the functions that contain the validation of blocks.



            The wallet



            Almost all of the wallet's functionality is centered around the creation and receiving of transactions. These logically begin when the user wants to send Bitcoin. So a good starting place is the sendtoaddress RPC. Following this function will take you to CreateTransaction and later SelectCoins which are responsible for transaction creation and coin selection.



            Some other things that are interesting in the wallet would include wallet creation and loading which occurs in CreateWalletFromFile and wallet encryption and unlocking which have good starting points of the encryptwallet RPC and walletpassphrase RPC



            Startup and initialization



            Lastly some interesting occur during startup such as DNS seeding, connecting to nodes, loading the blockchain from disk, etc. The obvious and actual starting point is the main function. The main function is the entry point for pretty much every C/C++ program so it's a good place to look at for startup. Following the main function will bring you to AppInitMain which is where the bulk of loading and initialization occurs.






            share|improve this answer



























              3














              Introduction



              The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or transaction is received.



              There are generally three kinds of actions that Bitcoin Core does: validation and relay of blocks and transactions, the wallet, and startup



              Validation and relay



              In order for Bitcoin Core to be able to validate and relay a block or transaction, it has to first receive it. So logically the place to begin looking is at the point where a block or transaction has been received and it is beginning to be processed. That is in ProcessMessages function in src/net_processing.cpp. Within this function, there are several if statements for each type of network message that can be received.



              For transactions, you want to look at the if block for NetMsgType::TX. By reading through the code in this if block and following the functions that are called, you will eventually reach where a transaction is verified, added to the mempool, and relayed. The most important function within this block is AcceptToMemoryPool and that is where all of the validation for an unconfirmed transaction is done.



              For blocks, you want to look at the if block for NetMsgType::BLOCK. Reading through this code will lead you to ProcessNewBlock and later ActivateBestChain and ConnectTip which are the functions that contain the validation of blocks.



              The wallet



              Almost all of the wallet's functionality is centered around the creation and receiving of transactions. These logically begin when the user wants to send Bitcoin. So a good starting place is the sendtoaddress RPC. Following this function will take you to CreateTransaction and later SelectCoins which are responsible for transaction creation and coin selection.



              Some other things that are interesting in the wallet would include wallet creation and loading which occurs in CreateWalletFromFile and wallet encryption and unlocking which have good starting points of the encryptwallet RPC and walletpassphrase RPC



              Startup and initialization



              Lastly some interesting occur during startup such as DNS seeding, connecting to nodes, loading the blockchain from disk, etc. The obvious and actual starting point is the main function. The main function is the entry point for pretty much every C/C++ program so it's a good place to look at for startup. Following the main function will bring you to AppInitMain which is where the bulk of loading and initialization occurs.






              share|improve this answer

























                3












                3








                3







                Introduction



                The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or transaction is received.



                There are generally three kinds of actions that Bitcoin Core does: validation and relay of blocks and transactions, the wallet, and startup



                Validation and relay



                In order for Bitcoin Core to be able to validate and relay a block or transaction, it has to first receive it. So logically the place to begin looking is at the point where a block or transaction has been received and it is beginning to be processed. That is in ProcessMessages function in src/net_processing.cpp. Within this function, there are several if statements for each type of network message that can be received.



                For transactions, you want to look at the if block for NetMsgType::TX. By reading through the code in this if block and following the functions that are called, you will eventually reach where a transaction is verified, added to the mempool, and relayed. The most important function within this block is AcceptToMemoryPool and that is where all of the validation for an unconfirmed transaction is done.



                For blocks, you want to look at the if block for NetMsgType::BLOCK. Reading through this code will lead you to ProcessNewBlock and later ActivateBestChain and ConnectTip which are the functions that contain the validation of blocks.



                The wallet



                Almost all of the wallet's functionality is centered around the creation and receiving of transactions. These logically begin when the user wants to send Bitcoin. So a good starting place is the sendtoaddress RPC. Following this function will take you to CreateTransaction and later SelectCoins which are responsible for transaction creation and coin selection.



                Some other things that are interesting in the wallet would include wallet creation and loading which occurs in CreateWalletFromFile and wallet encryption and unlocking which have good starting points of the encryptwallet RPC and walletpassphrase RPC



                Startup and initialization



                Lastly some interesting occur during startup such as DNS seeding, connecting to nodes, loading the blockchain from disk, etc. The obvious and actual starting point is the main function. The main function is the entry point for pretty much every C/C++ program so it's a good place to look at for startup. Following the main function will bring you to AppInitMain which is where the bulk of loading and initialization occurs.






                share|improve this answer













                Introduction



                The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or transaction is received.



                There are generally three kinds of actions that Bitcoin Core does: validation and relay of blocks and transactions, the wallet, and startup



                Validation and relay



                In order for Bitcoin Core to be able to validate and relay a block or transaction, it has to first receive it. So logically the place to begin looking is at the point where a block or transaction has been received and it is beginning to be processed. That is in ProcessMessages function in src/net_processing.cpp. Within this function, there are several if statements for each type of network message that can be received.



                For transactions, you want to look at the if block for NetMsgType::TX. By reading through the code in this if block and following the functions that are called, you will eventually reach where a transaction is verified, added to the mempool, and relayed. The most important function within this block is AcceptToMemoryPool and that is where all of the validation for an unconfirmed transaction is done.



                For blocks, you want to look at the if block for NetMsgType::BLOCK. Reading through this code will lead you to ProcessNewBlock and later ActivateBestChain and ConnectTip which are the functions that contain the validation of blocks.



                The wallet



                Almost all of the wallet's functionality is centered around the creation and receiving of transactions. These logically begin when the user wants to send Bitcoin. So a good starting place is the sendtoaddress RPC. Following this function will take you to CreateTransaction and later SelectCoins which are responsible for transaction creation and coin selection.



                Some other things that are interesting in the wallet would include wallet creation and loading which occurs in CreateWalletFromFile and wallet encryption and unlocking which have good starting points of the encryptwallet RPC and walletpassphrase RPC



                Startup and initialization



                Lastly some interesting occur during startup such as DNS seeding, connecting to nodes, loading the blockchain from disk, etc. The obvious and actual starting point is the main function. The main function is the entry point for pretty much every C/C++ program so it's a good place to look at for startup. Following the main function will bring you to AppInitMain which is where the bulk of loading and initialization occurs.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Andrew ChowAndrew Chow

                34.4k42562




                34.4k42562



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Bitcoin Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f87450%2fwhere-in-bitcoin-core-does-it-do-x%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Log på Navigationsmenu

                    Creating second map without labels using QGIS?How to lock map labels for inset map in Print Composer?How to Force the Showing of Labels of a Vector File in QGISQGIS Valmiera, Labels only show for part of polygonsRemoving duplicate point labels in QGISLabeling every feature using QGIS?Show labels for point features outside map canvasAbbreviate Road Labels in QGIS only when requiredExporting map from composer in QGIS - text labels have moved in output?How to make sure labels in qgis turn up in layout map?Writing label expression with ArcMap and If then Statement?

                    Nuuk Indholdsfortegnelse Etyomologi | Historie | Geografi | Transport og infrastruktur | Politik og administration | Uddannelsesinstitutioner | Kultur | Venskabsbyer | Noter | Eksterne henvisninger | Se også | Navigationsmenuwww.sermersooq.gl64°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.75064°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.750DMI - KlimanormalerSalmonsen, s. 850Grønlands Naturinstitut undersøger rensdyr i Akia og Maniitsoq foråret 2008Grønlands NaturinstitutNy vej til Qinngorput indviet i dagAntallet af biler i Nuuk må begrænsesNy taxacentral mødt med demonstrationKøreplan. Rute 1, 2 og 3SnescootersporNuukNord er for storSkoler i Kommuneqarfik SermersooqAtuarfik Samuel KleinschmidtKangillinguit AtuarfiatNuussuup AtuarfiaNuuk Internationale FriskoleIlinniarfissuaq, Grønlands SeminariumLedelseÅrsberetning for 2008Kunst og arkitekturÅrsberetning for 2008Julie om naturenNuuk KunstmuseumSilamiutGrønlands Nationalmuseum og ArkivStatistisk ÅrbogGrønlands LandsbibliotekStore koncerter på stribeVandhund nummer 1.000.000Kommuneqarfik Sermersooq – MalikForsidenVenskabsbyerLyngby-Taarbæk i GrønlandArctic Business NetworkWinter Cities 2008 i NuukDagligt opdaterede satellitbilleder fra NuukområdetKommuneqarfik Sermersooqs hjemmesideTurist i NuukGrønlands Statistiks databankGrønlands Hjemmestyres valgresultaterrrWorldCat124325457671310-5