Permalink
Browse files

Don't do mempool lookups for "mempool" command without a filter

Github-Pull: #7174
Rebased-From: 96918a2
  • Loading branch information...
TheBlueMatt authored and laanwj committed Dec 5, 2015
1 parent f31955d commit 82aff880d32f73bae28aa2cc071348ada603159b
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/main.cpp
View
@@ -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();

0 comments on commit 82aff88

Please sign in to comment.