mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
p2p: Protect extra full outbound peers by network
If a peer is the only one of its network, protect it from eviction. This improves the diversity of outbound connections with respect to reachable networks. Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
This commit is contained in:
committed by
Amiti Uttarwar
parent
654d9bc276
commit
034f61f83b
@@ -1607,6 +1607,12 @@ std::unordered_set<Network> CConnman::GetReachableEmptyNetworks() const
|
||||
return networks;
|
||||
}
|
||||
|
||||
bool CConnman::MultipleManualOrFullOutboundConns(Network net) const
|
||||
{
|
||||
AssertLockHeld(m_nodes_mutex);
|
||||
return m_network_conn_counts[net] > 1;
|
||||
}
|
||||
|
||||
void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
|
||||
{
|
||||
AssertLockNotHeld(m_unused_i2p_sessions_mutex);
|
||||
|
||||
Reference in New Issue
Block a user