Skip to content

Commit b94ebc3

Browse files
author
Antoine Riard
committed
[doc] Clarify scope of eviction protection of outbound block-relay peers
Block-relay-only peers were introduced by bitcoin#15759. According to its author, it was intented to make them only immune to outbound peer rotation-based eviction and not from all eviction as modified comment leans to think of. Clearly indicate that outbound block-relay peers aren't protected from eviction by the bad/lagging chain logic.
1 parent a0a422c commit b94ebc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,8 +2021,8 @@ static void ProcessHeadersMessage(CNode& pfrom, CConnman& connman, ChainstateMan
20212021
if (!pfrom.fDisconnect && pfrom.IsFullOutboundConn() && nodestate->pindexBestKnownBlock != nullptr) {
20222022
// If this is an outbound full-relay peer, check to see if we should protect
20232023
// it from the bad/lagging chain logic.
2024-
// Note that block-relay-only peers are already implicitly protected, so we
2025-
// only consider setting m_protect for the full-relay peers.
2024+
// Note that outbound block-relay peers are excluded from this protection and
2025+
// thus passive of eviction by bad/lagging chain logic.
20262026
if (g_outbound_peers_with_protect_from_disconnect < MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT && nodestate->pindexBestKnownBlock->nChainWork >= ::ChainActive().Tip()->nChainWork && !nodestate->m_chain_sync.m_protect) {
20272027
LogPrint(BCLog::NET, "Protecting outbound peer=%d from eviction\n", pfrom.GetId());
20282028
nodestate->m_chain_sync.m_protect = true;

0 commit comments

Comments
 (0)