| 727 | } |
| 728 | |
| 729 | void ProcessMempoolMessage(CNode *pFrom, CDataStream &vRecv) { |
| 730 | LOCK2(cs_main, pFrom->cs_filter); |
| 731 | |
| 732 | vector<uint256> vtxid; |
| 733 | mempool.QueryHash(vtxid); |
| 734 | vector<CInv> vInv; |
| 735 | for (auto &hash : vtxid) { |
| 736 | CInv inv(MSG_TX, hash); |
| 737 | std::shared_ptr<CBaseTx> pBaseTx = mempool.Lookup(hash); |
| 738 | if (pBaseTx.get()) |
| 739 | continue; // another thread removed since queryHashes, maybe... |
| 740 | |
| 741 | if ((pFrom->pFilter && pFrom->pFilter->contains(hash)) || // other type transaction |
| 742 | (!pFrom->pFilter)) |
| 743 | vInv.push_back(inv); |
| 744 | |
| 745 | if (vInv.size() == MAX_INV_SZ) { |
| 746 | pFrom->PushMessage(NetMsgType::INV, vInv); |
| 747 | vInv.clear(); |
| 748 | } |
| 749 | } |
| 750 | if (vInv.size() > 0) pFrom->PushMessage(NetMsgType::INV, vInv); |
| 751 | } |
| 752 | |
| 753 | void ProcessAlertMessage(CNode *pFrom, CDataStream &vRecv) { |
| 754 | CAlert alert; |
no test coverage detected