Skip to content

Commit

Permalink
net_processing: Don't attempt to direct fetch blocks from a node not …
Browse files Browse the repository at this point in the history
…advertising blocks
  • Loading branch information
instagibbs committed Feb 23, 2024
1 parent 1ac627c commit b13c1fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2770,6 +2770,9 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c
LOCK(cs_main);
CNodeState *nodestate = State(pfrom.GetId());

// Header was sent, but blocks not advertised
if(!CanServeBlocks(peer)) return;

if (CanDirectFetch() && last_header.IsValid(BLOCK_VALID_TREE) && m_chainman.ActiveChain().Tip()->nChainWork <= last_header.nChainWork) {
std::vector<const CBlockIndex*> vToFetch;
const CBlockIndex* pindexWalk{&last_header};
Expand Down

0 comments on commit b13c1fc

Please sign in to comment.