Skip to content

Commit 5a0ba4d

Browse files
instagibbspatricklodder
authored andcommitted
Only request full blocks from the peer we thought had the block in-flight
This is a change in behavior so that if for some reason we request a block from a peer, we don't allow an unsolicited CMPCT_BLOCK announcement for that same block to cause a request for a full block from the uninvited peer (as some type of request is already outstanding from the original peer)
1 parent 6045e35 commit 5a0ba4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
34773477

34783478
if (pindex->nChainWork <= m_chainman.ActiveChain().Tip()->nChainWork || // We know something better
34793479
pindex->nTx != 0) { // We had this block at some point, but pruned it
3480-
if (fAlreadyInFlight) {
3480+
if (in_flight_same_peer) {
34813481
// We requested this block for some reason, but our mempool will probably be useless
34823482
// so we just grab the block via normal getdata
34833483
std::vector<CInv> vInv(1);
@@ -3562,7 +3562,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
35623562
}
35633563
}
35643564
} else {
3565-
if (fAlreadyInFlight) {
3565+
if (in_flight_same_peer) {
35663566
// We requested this block, but its far into the future, so our
35673567
// mempool will probably be useless - request the block normally
35683568
std::vector<CInv> vInv(1);

0 commit comments

Comments
 (0)