@@ -2208,15 +2208,15 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, const Peer& peer,
2208
2208
LOCK (cs_main);
2209
2209
CNodeState *nodestate = State (pfrom.GetId ());
2210
2210
2211
- // If this looks like it could be a block announcement (nCount <
2211
+ // If this looks like it could be a block announcement (nCount <=
2212
2212
// MAX_BLOCKS_TO_ANNOUNCE), use special logic for handling headers that
2213
2213
// don't connect:
2214
2214
// - Send a getheaders message in response to try to connect the chain.
2215
2215
// - The peer can send up to MAX_UNCONNECTING_HEADERS in a row that
2216
2216
// don't connect before giving DoS points
2217
2217
// - Once a headers message is received that is valid and does connect,
2218
2218
// nUnconnectingHeaders gets reset back to 0.
2219
- if (!m_chainman.m_blockman .LookupBlockIndex (headers[0 ].hashPrevBlock ) && nCount < MAX_BLOCKS_TO_ANNOUNCE) {
2219
+ if (!m_chainman.m_blockman .LookupBlockIndex (headers[0 ].hashPrevBlock ) && nCount <= MAX_BLOCKS_TO_ANNOUNCE) {
2220
2220
nodestate->nUnconnectingHeaders ++;
2221
2221
m_connman.PushMessage (&pfrom, msgMaker.Make (NetMsgType::GETHEADERS, m_chainman.ActiveChain ().GetLocator (m_chainman.m_best_header ), uint256 ()));
2222
2222
LogPrint (BCLog::NET, " received header %s: missing prev block %s, sending getheaders (%d) to end (peer=%d, nUnconnectingHeaders=%d)\n " ,
@@ -4772,7 +4772,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
4772
4772
// Try sending block announcements via headers
4773
4773
//
4774
4774
{
4775
- // If we have less than MAX_BLOCKS_TO_ANNOUNCE in our
4775
+ // If we have no more than MAX_BLOCKS_TO_ANNOUNCE in our
4776
4776
// list of block hashes we're relaying, and our peer wants
4777
4777
// headers announcements, then find the first header
4778
4778
// not yet known to our peer but would connect, and send.
0 commit comments