Skip to content

Commit b3a515c

Browse files
committed
Clarify comments around outbound peer eviction
1 parent daffaf0 commit b3a515c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/net_processing.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3953,10 +3953,10 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
39533953
});
39543954
}
39553955

3956-
// Check whether we have too many outbound peers
3956+
// Check whether we have too many OUTBOUND_FULL_RELAY peers
39573957
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
39603960
// us a new block, with ties broken by choosing the more recent
39613961
// connection (higher node id)
39623962
NodeId worst_peer = -1;
@@ -3965,7 +3965,8 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
39653965
m_connman.ForEachNode([&](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
39663966
AssertLockHeld(::cs_main);
39673967

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
39693970
if (!pnode->IsFullOutboundConn() || pnode->fDisconnect) return;
39703971
CNodeState *state = State(pnode->GetId());
39713972
if (state == nullptr) return; // shouldn't be possible, but just in case

0 commit comments

Comments
 (0)