Skip to content

Commit 632ae47

Browse files
committed
update comment on MinimumChainWork check
1 parent c20a5ce commit 632ae47

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,13 +4142,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41424142

41434143
LOCK(cs_main);
41444144

4145-
// Note that if we were to be on a chain that forks from the checkpointed
4146-
// chain, then serving those headers to a peer that has seen the
4147-
// checkpointed chain would cause that peer to disconnect us. Requiring
4148-
// that our chainwork exceed the minimum chain work is a protection against
4149-
// being fed a bogus chain when we started up for the first time and
4150-
// getting partitioned off the honest network for serving that chain to
4151-
// others.
4145+
// Don't serve headers from our active chain until our chainwork is at least
4146+
// the minimum chain work. This prevents us from starting a low-work headers
4147+
// sync that will inevitably be aborted by our peer.
41524148
if (m_chainman.ActiveTip() == nullptr ||
41534149
(m_chainman.ActiveTip()->nChainWork < m_chainman.MinimumChainWork() && !pfrom.HasPermission(NetPermissionFlags::Download))) {
41544150
LogDebug(BCLog::NET, "Ignoring getheaders from peer=%d because active chain has too little work; sending empty response\n", pfrom.GetId());

0 commit comments

Comments
 (0)