Skip to content

Commit 9fcdb9f

Browse files
committed
Merge bitcoin#26172: p2p: ProcessHeadersMessage(): fix received_new_header
bdcafb9 p2p: ProcessHeadersMessage(): fix received_new_header (Larry Ruane) Pull request description: Follow-up to bitcoin#25717. The commit "Utilize anti-DoS headers download strategy" changed how this bool variable is computed, so that its value is now the opposite of what it should be. Prior to bitcoin#25717: ``` bool received_new_header{WITH_LOCK(::cs_main, return m_chainman.m_blockman.LookupBlockIndex(headers.back().GetHash()) == nullptr)}; ``` After bitcoin#25717 (simplified): ``` { LOCK(cs_main); last_received_header = m_chainman.m_blockman.LookupBlockIndex(headers.back().GetHash()); } bool received_new_header{last_received_header != nullptr}; ``` ACKs for top commit: dergoegge: ACK bdcafb9 glozow: ACK bdcafb9, I believe this is correct and don't see anything to suggest the switch was intentional. stickies-v: ACK bdcafb9 Tree-SHA512: 35c12762f1429585a0b1c15053e310e83efb28c3d8cbf4092fad9fe81c893f6d766df1f2b20624882acb9654d0539a0c871f587d7090dc2a198115adf59db3ec
2 parents eeac05a + bdcafb9 commit 9fcdb9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
28462846

28472847
// If we don't have the last header, then this peer will have given us
28482848
// something new (if these headers are valid).
2849-
bool received_new_header{last_received_header != nullptr};
2849+
bool received_new_header{last_received_header == nullptr};
28502850

28512851
// Now process all the headers.
28522852
BlockValidationState state;

0 commit comments

Comments
 (0)