You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LogPrint(BCLog::NET, "Discarding received headers and pausing header sync from peer=%d, because we are too far ahead of block sync (%d > %d, %d new headers received)\n", pfrom.GetId(), pindexBestHeader->nHeight, m_chainman.ActiveHeight(), nCount);
2018
+
LOCK(cs_main);
2019
+
CNodeState *nodestate = State(pfrom.GetId());
2020
+
if (nodestate->fSyncStarted) {
2021
+
// Cancel sync from this node, so we don't penalize it later.
2022
+
// This will cause us to automatically start syncing from a different node (or restart syncing from the same node) later,
// In this case the right thing to do is simply stop syncing headers from this
2107
2123
// peer; it's redundant. Here we do nothing; since we don't ask the peer for
2108
2124
// more headers, it will stop sending them.
2109
-
} elseif (got_enough_headers) {
2110
-
// If we're trying to save memory on headers, and we've already got plenty of headers,
2111
-
// pause until we're ready for more.
2112
-
LogPrint(BCLog::NET, "Pausing header sync from peer=%d, because the last one was too far ahead of block sync (%d >> %d)\n", pfrom.GetId(), pindexLast->nHeight, m_chainman.ActiveHeight());
2113
-
if (nodestate->fSyncStarted) {
2114
-
// Cancel sync from this node, so we don't penalize it later.
2115
-
// This will cause us to automatically start syncing from a different node (or restart syncing from the same node) later,
2116
-
// if we still need to sync headers.
2117
-
nSyncStarted--;
2118
-
nodestate->fSyncStarted = false;
2119
-
nodestate->m_headers_sync_timeout = 0us;
2120
-
}
2121
2125
} else {
2122
2126
// TODO: optimize: if pindexLast is an ancestor of m_chainman.ActiveChain().Tip or pindexBestHeader, continue
0 commit comments