mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
addrman: change Select to support multiple networks
This commit is contained in:
parent
f698636ec8
commit
829becd990
7 changed files with 63 additions and 41 deletions
|
|
@ -2739,7 +2739,11 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, Spa
|
|||
// If preferred_net has a value set, pick an extra outbound
|
||||
// peer from that network. The eviction logic in net_processing
|
||||
// ensures that a peer from another network will be evicted.
|
||||
std::tie(addr, addr_last_try) = addrman.Select(false, preferred_net);
|
||||
std::unordered_set<Network> preferred_nets;
|
||||
if (preferred_net.has_value()) {
|
||||
preferred_nets = {*preferred_net};
|
||||
}
|
||||
std::tie(addr, addr_last_try) = addrman.Select(false, preferred_nets);
|
||||
}
|
||||
|
||||
// Require outbound IPv4/IPv6 connections, other than feelers, to be to distinct network groups
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue