<p>It's an exponential distribution. Transactions are relayed through the inv messages, and there are indeed delays to prevent topological analysis. The timing depends on whether it is an inbound and outbound, should be lambda of 5 seconds for inbound connections, 2 for outbound connections.</p>
<p>Relevant code is here for the delay: <a href="https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/net_processing.cpp#L5784" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/net_processing.cpp#L5784</a>
Function for the exp dist function: <a href="https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/random.cpp#L764" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/random.cpp#L764</a></p>

CC BY-SA 4.0
2024-03-06T07:32:09.093Z
2024-03-06T07:32:09.093Z
Thomas
<p>I would like to know in which files of the Bitcoin core code can I find the transaction propagation algorithm.</p>
<p>The exact thing I need is to know the distribution range when the transactions are sent to the inbound and outbound connections.</p>
<p>I guess it is some uniform distribution or something like that, but never find that in the Bitcoin core code.</p>

<bitcoin-core-development><unconfirmed-transactions><algorithms><transaction-propagation><random>
Distribution range for sending transactions to inbound and outbound connections
Thomas
# Distribution range for sending transactions to inbound and outbound connections

(Asked by: username_0 on 2024-03-05)

I would like to know in which files of the Bitcoin core code can I find the transaction propagation algorithm.

The exact thing I need is to know the distribution range when the transactions are sent to the inbound and outbound connections.

I guess it is some uniform distribution or something like that, but never find that in the Bitcoin core code.

**Tags:** bitcoin-core-development, unconfirmed-transactions, algorithms, transaction-propagation, random


---

## 1 answers

### Answer by username_0 on 2024-03-06. Score: 2

It's an exponential distribution. Transactions are relayed through the inv messages, and there are indeed delays to prevent topological analysis. The timing depends on whether it is an inbound and outbound, should be lambda of 5 seconds for inbound connections, 2 for outbound connections.

Relevant code is here for the delay: <https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/net_processing.cpp#L5784>
Function for the exp dist function: <https://github.com/bitcoin/bitcoin/blob/2b260eadf7960290328e13dbdb029fd506105ca4/src/random.cpp#L764>


---

