Skip to content

Commit c4af738

Browse files
committed
Fix ignoring tx data requests when fPauseSend is set on a peer
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).
1 parent 67447ba commit c4af738

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
@@ -1226,10 +1226,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
12261226
}
12271227
} // release cs_main
12281228

1229-
if (it != pfrom->vRecvGetData.end()) {
1229+
if (it != pfrom->vRecvGetData.end() && !pfrom->fPauseSend) {
12301230
const CInv &inv = *it;
1231-
it++;
12321231
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) {
1232+
it++;
12331233
ProcessGetBlockData(pfrom, consensusParams, inv, connman, interruptMsgProc);
12341234
}
12351235
}

0 commit comments

Comments
 (0)