diff options
author | fanquake <fanquake@gmail.com> | 2022-06-08 11:19:28 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-06-08 11:21:38 +0100 |
commit | b9416c3847cd347238a9d75d949327f69e187d79 (patch) | |
tree | 2add8e79d6514fafe775aaf2a9368160ddc3759b /src/rpc/util.h | |
parent | bbf2a2504459ae70f1d5dc356f9d25f4ccfafdc8 (diff) | |
parent | 292828cd7744ec7eadede4ad54aa2117087c5435 (diff) |
Merge bitcoin/bitcoin#25096: [net] Minor improvements to addr caching
292828cd7744ec7eadede4ad54aa2117087c5435 [test] Test addr cache for multiple onion binds (dergoegge)
3382905befd23364989d941038bf7b1530fea0dc [net] Seed addr cache randomizer with port from binding address (dergoegge)
f10e80b6e4fbc151abbf1c20fbdcc3581d3688f0 [net] Use ConnectedThroughNetwork() instead of GetNetwork() to seed addr cache randomizer (dergoegge)
Pull request description:
The addr cache id randomizer is currently supposed to be seeded with the network of the inbound connection and the local socket (only the address is used not the port): https://github.com/bitcoin/bitcoin/blob/a8098f2cef53ec003edae91100afce564e9c6f23/src/net.cpp#L2800-L2804
For inbound onion connections `CNode::addr.GetNetwork()` returns `NET_UNROUTABLE` and `CNode::addrBind` is set to `127.0.0.1:<onion bind port>`. This results in the same addr cache for all inbound connections on 127.0.0.1 binds.
To avoid the same addr cache across all onion and other 127.0.0.1 binds, we should seed the addr cache randomizer with the correct network for inbound onion connections (using `CNode::ConnectedThroughNetwork()`) as well as the port of `CNode::addrBind`.
ACKs for top commit:
sipa:
utACK 292828cd7744ec7eadede4ad54aa2117087c5435
mzumsande:
Code Review ACK 292828cd7744ec7eadede4ad54aa2117087c5435
naumenkogs:
utACK 292828cd7744ec7eadede4ad54aa2117087c5435
Tree-SHA512: d0be13bab6bc121c2926d4b168687f6c2ed4ce0c9dd19be71eb4886adeba8afc3daacdc4e232a0ba3b03a89d69b618abc5595b69abd1ad0c476d825bc6ea1f9f
Diffstat (limited to 'src/rpc/util.h')
0 files changed, 0 insertions, 0 deletions