<blockquote>
<p>Is there some kind of queue implemented in the Bitcoin node to store all the incoming transactions before adding them to the mempool?</p>
</blockquote>
<p>Simply the network buffers.</p>
<p>At least in the current Bitcoin Core implementation, messages received from peers are processed one by one by taking them from the network receive buffers. If that message includes a transaction, it will be processed (including adding to the mempool if applicable, and relaying to other parties) before continuing to process further messages from the same or other peers.</p>
<p>Obviously, this is an implementation detail, and other Bitcoin software may operate differently.</p>

CC BY-SA 4.0
2023-03-01T22:42:45.060Z
2023-03-01T22:42:45.060Z
Pieter Wuille
<p>A transaction is stored in the mempool before it is confirmed. However, the Bitcoin node can't verify incoming transactions with 'light speed' to add them to a mempool—it obviously needs some time. So, all the incoming transactions have to wait for their turn to be verified before getting added to a mempool.<br />
Is there some kind of queue implemented in the Bitcoin node to store all the incoming transactions before adding them to the mempool?</p>

<transactions><transaction-verification><mempool>
Where is a transaction stored before getting added to the mempool?
Nazarevsky
# Where is a transaction stored before getting added to the mempool?

(Asked by: username_0 on 2023-03-01)

A transaction is stored in the mempool before it is confirmed. However, the Bitcoin node can't verify incoming transactions with 'light speed' to add them to a mempool—it obviously needs some time. So, all the incoming transactions have to wait for their turn to be verified before getting added to a mempool.  
Is there some kind of queue implemented in the Bitcoin node to store all the incoming transactions before adding them to the mempool?

**Tags:** transactions, transaction-verification, mempool


---

## 1 answers

### Answer by username_1 on 2023-03-01. Score: 0 | Accepted answer

> Is there some kind of queue implemented in the Bitcoin node to store all the incoming transactions before adding them to the mempool?

Simply the network buffers.

At least in the current Bitcoin Core implementation, messages received from peers are processed one by one by taking them from the network receive buffers. If that message includes a transaction, it will be processed (including adding to the mempool if applicable, and relaying to other parties) before continuing to process further messages from the same or other peers.

Obviously, this is an implementation detail, and other Bitcoin software may operate differently.


---

