Skip to content

Commit

Permalink
Fix ignoring tx data requests when fPauseSend is set on a peer
Browse files Browse the repository at this point in the history
This resolves a bug introduced in
66aa1d5 where, if when responding
to a series of transaction requests in a getdata we hit the send
buffer limit and set fPauseSend, we will skip one transaction per
call to ProcessGetData.

Bug found by Cory Fields (@theuni).

Github-Pull: #2677
Rebased-From: 3355026
  • Loading branch information
TheBlueMatt authored and furszy committed Dec 14, 2021
1 parent 10cedd0 commit 946444e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,10 @@ void static ProcessGetData(CNode* pfrom, CConnman* connman, const std::atomic<bo
}
} // release cs_main

if (it != pfrom->vRecvGetData.end()) {
if (it != pfrom->vRecvGetData.end() && !pfrom->fPauseSend) {
const CInv &inv = *it;
it++;
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK) {
it++;
ProcessGetBlockData(pfrom, inv, connman, interruptMsgProc);
}
}
Expand Down

0 comments on commit 946444e

Please sign in to comment.