Ava Chow
06329eb134
Merge bitcoin/bitcoin#29436 : net: call Select with reachable networks in ThreadOpenConnections
...
e4e3b44e9c net: call `Select` with reachable networks in `ThreadOpenConnections` (brunoerg)
829becd990 addrman: change `Select` to support multiple networks (brunoerg)
f698636ec8 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).

ACKs for top commit:
achow101:
ACK e4e3b44e9c
vasild:
ACK e4e3b44e9c
naumenkogs:
ACK e4e3b44e9c
Tree-SHA512: e8466b72b85bbc2ad8bfb14471eb27d2c50d4e84218f5ede2c15a6fa3653af61b488cde492dbd398f7502bd847e95bfee1abb7e01092daba2236d3ce3d6d2268
2024-09-16 16:49:25 -04:00
..
2024-09-16 16:49:25 -04:00
2024-09-06 09:08:10 -04:00
2024-08-28 18:42:10 +02:00
2024-08-16 19:27:38 +01:00
2024-09-12 15:01:20 +02:00
2024-09-06 09:08:10 -04:00
2024-09-13 10:14:53 +02:00
2024-09-06 09:08:10 -04:00
2024-09-12 16:39:34 +01:00
2024-06-13 13:17:57 +01:00
2024-08-29 13:49:57 +02:00
2024-06-12 14:38:39 +01:00
2024-09-16 15:56:02 -04:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2024-09-16 15:56:02 -04:00
2024-09-16 16:17:59 -04:00
2024-08-28 15:56:15 +01:00
2024-09-07 18:15:41 +01:00
2024-07-24 09:57:49 +01:00
2024-09-16 16:49:25 -04:00
2024-08-30 21:31:39 +01:00
2024-09-12 15:01:20 +02:00
2024-09-09 12:44:29 -04:00
2024-08-29 13:49:57 +02:00
2024-09-14 20:33:32 +03:00
2024-07-01 12:39:53 -04:00
2024-07-30 14:06:58 -04:00
2024-07-30 14:06:58 -04:00
2024-09-10 12:58:54 -03:00
2024-09-10 12:58:54 -03:00
2024-09-10 12:58:54 -03:00
2024-08-03 21:59:54 +02:00
2024-08-29 13:49:57 +02:00
2024-05-30 08:35:18 -04:00
2024-05-16 10:16:08 -05:00
2024-08-06 11:03:31 +02:00
2024-08-06 11:03:31 +02:00
2024-09-13 16:10:31 +02:00
2024-09-04 14:47:38 -04:00
2024-07-24 17:40:18 +02:00
2024-05-01 08:33:04 +02:00
2024-08-06 01:38:10 +02:00
2024-09-06 09:08:10 -04:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2024-05-16 10:16:08 -05:00
2024-08-04 14:24:43 +02:00
2024-08-06 01:38:10 +02:00
2024-08-13 14:00:33 -03:00
2024-08-13 14:00:33 -03:00
2024-08-27 07:00:27 +02:00
2024-08-29 12:38:37 +01:00
2024-05-01 08:33:04 +02:00
2024-09-12 15:15:36 -04:00
2024-09-12 14:24:26 +01:00
2024-08-08 22:51:24 +02:00
2024-08-05 22:34:35 -04:00
2024-06-07 13:55:23 -04:00
2024-07-24 17:40:18 +02:00
2024-07-24 17:40:18 +02:00
2024-06-07 13:55:23 -04:00
2024-07-04 22:35:29 +02:00
2024-08-29 13:49:57 +02:00
2024-05-16 15:03:13 -04:00
2024-08-13 07:44:31 +02:00
2024-08-29 13:49:57 +02:00
2024-07-24 09:39:35 +02:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2024-09-09 12:29:17 -04:00
2024-09-14 20:33:32 +03:00
2024-07-11 19:08:46 +01:00
2024-06-26 15:28:26 -04:00
2024-06-12 16:19:50 -03:00
2024-09-16 15:56:02 -04:00
2024-09-06 09:08:10 -04:00
2024-07-30 14:06:58 -04:00
2024-08-04 08:52:22 +02:00
2024-08-04 08:51:36 +02:00
2024-08-04 06:43:00 +02:00
2024-09-05 07:17:22 +02:00
2024-06-18 12:24:48 +00:00
2024-07-08 11:12:01 +02:00
2024-05-16 10:16:08 -05:00
2024-09-16 13:59:22 -04:00
2024-09-02 15:42:44 +01:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2024-09-16 16:49:25 -04:00
2024-09-10 18:08:32 -03:00
2024-08-13 07:44:31 +02:00
2024-07-01 12:39:53 -04:00
2024-09-16 15:47:04 -04:00
2024-09-10 11:20:40 -03:00
2024-05-03 14:20:44 -03:00
2024-05-03 14:20:44 -03:00
2024-09-02 15:43:33 +01:00
2024-09-02 15:43:33 +01:00
2024-07-12 11:19:00 +02:00
2024-05-21 13:59:33 -04:00
2024-05-16 10:16:08 -05:00
2024-07-11 19:08:46 +01:00
2024-08-28 19:11:59 +02:00
2024-08-28 19:09:51 +02:00
2024-08-29 13:49:57 +02:00
2024-07-06 09:06:36 -04:00
2024-07-19 22:01:01 +01:00
2024-09-13 10:50:43 -04:00
2024-07-08 11:12:01 +02:00
2024-08-29 13:49:57 +02:00
2024-08-13 07:44:31 +02:00
2024-07-08 11:12:01 +02:00
2024-05-16 18:16:46 +02:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2024-08-29 13:49:57 +02:00
2024-08-29 13:49:57 +02:00
2024-09-16 15:56:02 -04:00
2024-08-29 13:49:57 +02:00
2024-09-06 15:57:00 +02:00
2024-08-29 13:49:57 +02:00
2024-08-05 17:25:57 -04:00
2024-08-07 20:00:28 +01:00
2024-07-24 09:15:34 +02:00
2024-09-06 17:36:18 +02:00
2024-09-10 18:08:32 -03:00
2024-09-13 16:10:31 +02:00
2024-08-29 13:49:57 +02:00
2024-07-25 11:01:22 +01:00
2024-07-08 11:12:01 +02:00