net_processing: fix for merge of bitcoin/bitcoin#25717 where have_headers_sync was unused

This commit is contained in:
Byron Hambly 2024-12-03 10:06:38 +02:00
parent 7fde338945
commit b4b6a0705e

View file

@ -2895,7 +2895,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
// headers at this point. Our logic is slightly more complex, to work around an apparent
// bug in the Bitcoin Core state machine, where we can end up downloading headers from
/// lots of peers at the same time by accident.
if (nCount == MAX_HEADERS_RESULTS) {
if (nCount == MAX_HEADERS_RESULTS && !have_headers_sync) {
LOCK(cs_main);
CNodeState *nodestate = State(pfrom.GetId());