mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-14 17:44:59 +01:00
9b8dcb25b5[net processing] Rename PoissonNextSendInbound to NextInvToInbounds (John Newbery)ea99f5d01e[net processing] Move PoissonNextSendInbound to PeerManager (John Newbery)bb060746dfscripted-diff: replace PoissonNextSend with GetExponentialRand (John Newbery)03cfa1b603[refactor] Use uint64_t and std namespace in PoissonNextSend (John Newbery)9e64d69bf7[move] Move PoissonNextSend to src/random and update comment (John Newbery) Pull request description: `PoissonNextSend` and `PoissonNextSendInbound` are used in the p2p code to obfuscate various regularly occurring processes, in order to make it harder for others to get timing-based information deterministically. The naming of these functions has been confusing to several people (including myself, see also #23347) because the resulting random timestamps don't follow a Poisson distribution but an exponential distribution (related to events in a Poisson process, hence the name). This PR - moves `PoissonNextSend()` out of `net` to `random` and renames it to `GetExponentialRand()` - moves `PoissonNextSendInbound()` out of `CConnman` to `PeerManager` and renames it to `NextInvToInbounds()` - adds documentation for these functions This is work by jnewbery - due to him being less active currently, I opened the PR and will address feedback. ACKs for top commit: jnewbery: ACK9b8dcb25b5hebasto: ACK9b8dcb25b5, I have reviewed the code and it looks OK, I agree it can be merged. theStack: ACK9b8dcb25b5📊 Tree-SHA512: 85c366c994e7147f9981fe863fb9838502643fa61ffd32d55a43feef96a38b79a5daa2c4d38ce01074897cc95fa40c76779816edad53f5265b81b05c3a1f4f50
5.0 KiB
5.0 KiB