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

How to use dependency injection and avoid temporal coupling?

Why did the Apollo 13 crew extend the LM landing gear?

Can my company stop me from working overtime?

Why does this derived table improve performance?

SafeCracker #3 - We've Been Blocked

Is there an official reason for not adding a post-credits scene?

Has a commercial or military jet bi-plane ever been manufactured?

Copy previous line to current line from text file

Why aren't nationalizations in Russia described as socialist?

Floor of Riemann zeta function

Does it make sense for a function to return a rvalue reference

Shutter speed -vs- effective image stabilisation

ZSPL language, anyone heard of it?

How long would it take for people to notice a mass disappearance?

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

US born but as a child of foreign diplomat

Adding command shortcuts to bin

Identifying characters

What was the first story to feature the plot "the monsters were human all along"?

What does this wavy downward arrow preceding a piano chord mean?

Introducing Gladys, an intrepid globetrotter

Where can I go to avoid planes overhead?

Out of scope work duties and resignation

Point of the Dothraki's attack in GoT S8E3?



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













2















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


























    2















    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
























      2












      2








      2








      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 1 hour ago









      Andrew ChowAndrew Chow

      34.4k42562




      34.4k42562




















          1 Answer
          1






          active

          oldest

          votes


















          2














          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









            2














            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



























              2














              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

























                2












                2








                2







                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 1 hour 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

                    Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

                    The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу