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.

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.