Which part of code (function) handles received transactions? I was trying to understand the flow of control between functions (operations performed and their order) when a transaction is received.
Any transaction

main.cpp, AcceptToMemoryPool:

bool AcceptToMemoryPool(CTxMemPool&amp; pool, CValidationState &amp;state, const CTransaction &amp;tx, bool fLimitFree,
                        bool* pfMissingInputs, bool fRejectInsaneFee)


A transaction that pays to or from you

wallet.cpp, CWallet::AddToWallet:

bool CWallet::AddToWallet(const CWalletTx&amp; wtxIn, bool fFromLoadWallet)