aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2015-12-05 17:45:44 +0800
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-07 12:35:20 +0100
commit82aff880d32f73bae28aa2cc071348ada603159b (patch)
tree1bb98065cd832afa6a9a35ec828a53d35580abcc
parentf31955d9da152e5e849575f0297f8fe1904cbfbc (diff)
downloadbitcoin-82aff880d32f73bae28aa2cc071348ada603159b.tar.xz
Don't do mempool lookups for "mempool" command without a filter
Github-Pull: #7174 Rebased-From: 96918a2f0990a8207d7631b8de73af8ae5d24aeb
-rw-r--r--src/main.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f7b9d073ed..20e59b9dd4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4994,12 +4994,13 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
vector<CInv> vInv;
BOOST_FOREACH(uint256& hash, vtxid) {
CInv inv(MSG_TX, hash);
- CTransaction tx;
- bool fInMemPool = mempool.lookup(hash, tx);
- if (!fInMemPool) continue; // another thread removed since queryHashes, maybe...
- if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(tx)) ||
- (!pfrom->pfilter))
- vInv.push_back(inv);
+ if (pfrom->pfilter) {
+ CTransaction tx;
+ bool fInMemPool = mempool.lookup(hash, tx);
+ if (!fInMemPool) continue; // another thread removed since queryHashes, maybe...
+ if (!pfrom->pfilter->IsRelevantAndUpdate(tx)) continue;
+ }
+ vInv.push_back(inv);
if (vInv.size() == MAX_INV_SZ) {
pfrom->PushMessage("inv", vInv);
vInv.clear();