diff options
author | Ava Chow <github@achow101.com> | 2024-09-16 16:49:25 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-09-16 16:49:25 -0400 |
commit | 06329eb13488640159057c897978b3f0f2e33ab5 (patch) | |
tree | 67dc9b25d37d4ca6b892d9bed924a618f8cbf1b1 /src/test/logging_tests.cpp | |
parent | e983ed41d9f78b15f6107c3aed7c9f5b200cf80e (diff) | |
parent | e4e3b44e9cc7227b3ad765397c884999f57bac2e (diff) |
Merge bitcoin/bitcoin#29436: net: call `Select` with reachable networks in `ThreadOpenConnections`
e4e3b44e9cc7227b3ad765397c884999f57bac2e net: call `Select` with reachable networks in `ThreadOpenConnections` (brunoerg)
829becd990b504a2e8a57fa8a6ff6ac6ae8ff900 addrman: change `Select` to support multiple networks (brunoerg)
f698636ec86c004ab331994559c163b7319e6423 net: add `All()` in `ReachableNets` (brunoerg)
Pull request description:
This PR changes addrman's `Select` to support multiple networks and change `ThreadOpenConnections` to call it with reachable networks. It can avoid unnecessary `Select` calls and avoid exceeding the max number of tries (100), especially when turning a clearnet + Tor/I2P/CJDNS node to Tor/I2P/CJDNS. Compared to #29330, this approach is "less aggresive". It does not add a new init flag and does not impact address relay.
I did an experiment of calling `Select` without passing a network until it finds an address from a network that compose 20% ~ 25% of the addrman (limited to 100 tries).
![Screenshot 2024-02-14 at 14 37 58](https://github.com/bitcoin/bitcoin/assets/19480819/7b6863a5-d7a6-40b6-87d5-01667c2de66a)
ACKs for top commit:
achow101:
ACK e4e3b44e9cc7227b3ad765397c884999f57bac2e
vasild:
ACK e4e3b44e9cc7227b3ad765397c884999f57bac2e
naumenkogs:
ACK e4e3b44e9cc7227b3ad765397c884999f57bac2e
Tree-SHA512: e8466b72b85bbc2ad8bfb14471eb27d2c50d4e84218f5ede2c15a6fa3653af61b488cde492dbd398f7502bd847e95bfee1abb7e01092daba2236d3ce3d6d2268
Diffstat (limited to 'src/test/logging_tests.cpp')
0 files changed, 0 insertions, 0 deletions