Skip to content

Commit

Permalink
revert (#78) & fix: disabled more getheaders (#126)
Browse files Browse the repository at this point in the history
* revert&fix: disabled more getheaders
* remove: printf
  • Loading branch information
decryp2kanon committed May 11, 2020
1 parent 6c82cbf commit 7c45e62
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,16 +1398,14 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve
}

// FIXME.SUGAR
// 120x bitcoin // IBD: disable additional download during IBD, due to too much traffic
/*
if (nCount == MAX_HEADERS_RESULTS) {
// IBD: reduce frequency of additional downloading during IBD, against too much traffic
if (nCount == MAX_HEADERS_RESULTS && (pindexLast->nHeight) % (MAX_HEADERS_RESULTS * 2) == 0) {
// Headers message had its maximum size; the peer may have more headers.
// TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue
// from there instead.
LogPrint(BCLog::NET, "more getheaders (%d) to end to peer=%d (startheight:%d)\n", pindexLast->nHeight, pfrom->GetId(), pfrom->nStartingHeight);
connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexLast), uint256()));
}
*/

bool fCanDirectFetch = CanDirectFetch(chainparams.GetConsensus());
// If this set of headers is valid and ends in a block with at least as
Expand Down

0 comments on commit 7c45e62

Please sign in to comment.