aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2018-02-08 18:00:06 -0500
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-12 10:30:50 +0100
commit0f616517e1f24a270b4599b04e16f21f7137d77e (patch)
treef57278fc8947fb41549ec1265b8cbe8fd1f546c1
parentd44cd7ed4b494b64f93b395abc2476ef3f1b5028 (diff)
downloadbitcoin-0f616517e1f24a270b4599b04e16f21f7137d77e.tar.xz
Fix ignoring tx data requests when fPauseSend is set on a peer
This resolves a bug introduced in 66aa1d58a158991a8014a91335b5bc9c00062f56 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: #12392 Rebased-From: c4af7387634765d254d1432746385cf35917d367 Tree-SHA512: d2f7707eb9f925a655f66e5e77ce406c5266f7b2feccd5bcdabf6d5bc27a3f6578e753fac83d9c8c3fd7cf7de6fee086eee2f95f77af99ea2c4e5ae77c322c58
-rw-r--r--src/net_processing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 3cf96be61a..f1260f3ae4 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1225,10 +1225,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
}
} // 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 || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) {
+ it++;
ProcessGetBlockData(pfrom, consensusParams, inv, connman, interruptMsgProc);
}
}