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

CC BY-SA 3.0
2014-10-21T19:31:41.133Z
can you please explain the arguments passed ?
somesh
CC BY-SA 3.0
2014-10-22T02:13:53.263Z
@somesh Could you explain why you want to know? I initially assumed that you wanted to instrument the code somehow.
Nick ODell
CC BY-SA 3.0
2014-10-21T19:18:01.617Z
2014-10-22T02:13:07.417Z
2014-10-22T02:13:07.417Z
Nick ODell
<p>I was trying to understand the flow of control between functions (operations performed and their order) when a transaction is received.</p>

CC BY-SA 3.0
2014-10-20T22:02:17.057Z
When *any* transaction is recieved, or just when you recieve a transaction that pays to you?
Nick ODell
CC BY-SA 3.0
2014-10-21T19:00:08.703Z
In both case, which functions will be called ? and in what order?
somesh
<transactions><bitcoind><bitcoin-core-development>
Which part of code (function) handles received transactions?
somesh
# Which part of code (function) handles received transactions?

(Asked by: username_0 on 2014-10-17)

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

**Tags:** transactions, bitcoind, bitcoin-core-development

> **Comments:**
> **username_1**: When *any* transaction is recieved, or just when you recieve a transaction that pays to you?  
> **username_0**: In both case, which functions will be called ? and in what order?  

---

## 1 answers

### Answer by username_1 on 2014-10-21. Score: 1 | Accepted answer

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)

> **Comments:**
> **username_0**: can you please explain the arguments passed ?  
> **username_1**: @username_0 Could you explain why you want to know? I initially assumed that you wanted to instrument the code somehow.  

---

