Remove mempool p2p message #284

This commit is contained in:
Duke
2023-04-06 12:59:31 -04:00
parent f0ee52a94d
commit 15aaf4af44
3 changed files with 0 additions and 33 deletions

View File

@@ -7672,31 +7672,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
Misbehaving(pfrom->GetId(), nDoS);
}
}
} else if (strCommand == NetMsgType::MEMPOOL) {
LOCK2(cs_main, pfrom->cs_filter);
//LogPrintf("%s: mempool request from %s",__func__, pfrom->addr.ToString().c_str());
// TODO: limit mempool requests per time and per peer
std::vector<uint256> vtxid;
mempool.queryHashes(vtxid);
vector<CInv> vInv;
BOOST_FOREACH(uint256& hash, vtxid) {
CInv inv(MSG_TX, hash);
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(NetMsgType::INV, vInv);
vInv.clear();
}
}
if (vInv.size() > 0)
pfrom->PushMessage(NetMsgType::INV, vInv);
} else if (strCommand == NetMsgType::ALERT) {
// Small DoS penalty so peers that send us lots of
// duplicate/expired/invalid-signature/whatever alerts