Merge pull request #7174

96918a2 Don't do mempool lookups for "mempool" command without a filter (Matt Corallo)
This commit is contained in:
Gregory Maxwell 2015-12-05 15:16:25 -08:00
commit 075faaebf2
No known key found for this signature in database
GPG key ID: EAB5AF94D9E9ABE7

View file

@ -4994,11 +4994,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
vector<CInv> vInv; vector<CInv> vInv;
BOOST_FOREACH(uint256& hash, vtxid) { BOOST_FOREACH(uint256& hash, vtxid) {
CInv inv(MSG_TX, hash); CInv inv(MSG_TX, hash);
if (pfrom->pfilter) {
CTransaction tx; CTransaction tx;
bool fInMemPool = mempool.lookup(hash, tx); bool fInMemPool = mempool.lookup(hash, tx);
if (!fInMemPool) continue; // another thread removed since queryHashes, maybe... if (!fInMemPool) continue; // another thread removed since queryHashes, maybe...
if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(tx)) || if (!pfrom->pfilter->IsRelevantAndUpdate(tx)) continue;
(!pfrom->pfilter)) }
vInv.push_back(inv); vInv.push_back(inv);
if (vInv.size() == MAX_INV_SZ) { if (vInv.size() == MAX_INV_SZ) {
pfrom->PushMessage("inv", vInv); pfrom->PushMessage("inv", vInv);