user19374: I was trying to understand the flow of control between functions (operations performed and their order) when a transaction is received.

user2306: Any transaction
main.cpp, AcceptToMemoryPool:
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
                        bool* pfMissingInputs, bool fRejectInsaneFee)

A transaction that pays to or from you
wallet.cpp, CWallet::AddToWallet:
bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)


19374: <p>I was trying to understand the flow of control between functions (operations performed and their order) when a transaction is received.</p>
 2306: <h3>Any transaction</h3>

<p><a href="https://github.com/bitcoin/bitcoin/blob/b88cb1a96eb670ca1f36cdc3fa908a23bffa18c5/src/main.cpp#L879" rel="nofollow">main.cpp, AcceptToMemoryPool</a>:</p>

<pre><code>bool AcceptToMemoryPool(CTxMemPool&amp; pool, CValidationState &amp;state, const CTransaction &amp;tx, bool fLimitFree,
                        bool* pfMissingInputs, bool fRejectInsaneFee)
</code></pre>

<h3>A transaction that pays to or from you</h3>

<p><a href="https://github.com/bitcoin/bitcoin/blob/d7e195048342afae9168377cebfc22ab000728a5/src/wallet.cpp#L550" rel="nofollow">wallet.cpp, CWallet::AddToWallet</a>:</p>

<pre><code>bool CWallet::AddToWallet(const CWalletTx&amp; wtxIn, bool fFromLoadWallet)
</code></pre>
