0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Move headers direct fetch to end of ProcessHeadersMessage

This commit is contained in:
Suhas Daftuar 2022-02-08 17:36:33 -05:00
parent 29c4518522
commit 2b341db731

View file

@ -2424,9 +2424,6 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
nodestate->m_last_block_announcement = GetTime();
}
// Consider immediately downloading blocks.
HeadersDirectFetchBlocks(pfrom, pindexLast);
// If we're in IBD, we want outbound peers that will serve us a useful
// chain. Disconnect peers that are on chains with insufficient work.
if (m_chainman.ActiveChainstate().IsInitialBlockDownload() && nCount != MAX_HEADERS_RESULTS) {
@ -2462,6 +2459,9 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
}
}
// Consider immediately downloading blocks.
HeadersDirectFetchBlocks(pfrom, pindexLast);
return;
}