File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3953,10 +3953,10 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
3953
3953
});
3954
3954
}
3955
3955
3956
- // Check whether we have too many outbound peers
3956
+ // Check whether we have too many OUTBOUND_FULL_RELAY peers
3957
3957
if (m_connman.GetExtraFullOutboundCount () > 0 ) {
3958
- // If we have more outbound peers than we target, disconnect one.
3959
- // Pick the outbound peer that least recently announced
3958
+ // If we have more OUTBOUND_FULL_RELAY peers than we target, disconnect one.
3959
+ // Pick the OUTBOUND_FULL_RELAY peer that least recently announced
3960
3960
// us a new block, with ties broken by choosing the more recent
3961
3961
// connection (higher node id)
3962
3962
NodeId worst_peer = -1 ;
@@ -3965,7 +3965,8 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
3965
3965
m_connman.ForEachNode ([&](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
3966
3966
AssertLockHeld (::cs_main);
3967
3967
3968
- // Ignore non-outbound peers, or nodes marked for disconnect already
3968
+ // Only consider OUTBOUND_FULL_RELAY peers that are not already
3969
+ // marked for disconnection
3969
3970
if (!pnode->IsFullOutboundConn () || pnode->fDisconnect ) return ;
3970
3971
CNodeState *state = State (pnode->GetId ());
3971
3972
if (state == nullptr ) return ; // shouldn't be possible, but just in case
You can’t perform that action at this time.
0 commit comments