Skip to content

Commit 13f9b20

Browse files
committed
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 cce9618 commit 13f9b20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/net_processing.cpp

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

43064306
if (pindex->nChainWork <= m_chainman.ActiveChain().Tip()->nChainWork || // We know something better
43074307
pindex->nTx != 0) { // We had this block at some point, but pruned it
4308-
if (fAlreadyInFlight) {
4308+
if (in_flight_same_peer) {
43094309
// We requested this block for some reason, but our mempool will probably be useless
43104310
// so we just grab the block via normal getdata
43114311
std::vector<CInv> vInv(1);
@@ -4384,7 +4384,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
43844384
}
43854385
}
43864386
} else {
4387-
if (fAlreadyInFlight) {
4387+
if (in_flight_same_peer) {
43884388
// We requested this block, but its far into the future, so our
43894389
// mempool will probably be useless - request the block normally
43904390
std::vector<CInv> vInv(1);

0 commit comments

Comments
 (0)