Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,458 Lines • ▼ Show 20 Lines | if (!m_chainman.ProcessNewBlockHeaders(config, headers, state, | ||||
LogPrintf("Disconnecting outbound peer %d -- headers " | LogPrintf("Disconnecting outbound peer %d -- headers " | ||||
"chain has insufficient work\n", | "chain has insufficient work\n", | ||||
pfrom.GetId()); | pfrom.GetId()); | ||||
pfrom.fDisconnect = true; | pfrom.fDisconnect = true; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!pfrom.fDisconnect && pfrom.IsOutboundOrBlockRelayConn() && | if (!pfrom.fDisconnect && pfrom.IsFullOutboundConn() && | ||||
nodestate->pindexBestKnownBlock != nullptr && | nodestate->pindexBestKnownBlock != nullptr) { | ||||
pfrom.m_tx_relay != nullptr) { | |||||
// If this is an outbound full-relay peer, check to see if we should | // If this is an outbound full-relay peer, check to see if we should | ||||
// protect it from the bad/lagging chain logic. Note that | // protect it from the bad/lagging chain logic. Note that | ||||
// block-relay-only peers are already implicitly protected, so we | // block-relay-only peers are already implicitly protected, so we | ||||
// only consider setting m_protect for the full-relay peers. | // only consider setting m_protect for the full-relay peers. | ||||
if (g_outbound_peers_with_protect_from_disconnect < | if (g_outbound_peers_with_protect_from_disconnect < | ||||
MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT && | MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT && | ||||
nodestate->pindexBestKnownBlock->nChainWork >= | nodestate->pindexBestKnownBlock->nChainWork >= | ||||
::ChainActive().Tip()->nChainWork && | ::ChainActive().Tip()->nChainWork && | ||||
▲ Show 20 Lines • Show All 3,419 Lines • Show Last 20 Lines |