diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e570a09b7a..547d9623a4 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -294,7 +294,8 @@ struct Peer { /** List of non-tx/non-block inventory items */ std::vector vInventoryOtherToSend GUARDED_BY(m_tx_inventory_mutex); /** Whether the peer has requested us to send our complete mempool. Only - * permitted if the peer has NetPermissionFlags::Mempool. See BIP35. */ + * permitted if the peer has NetPermissionFlags::Mempool or we advertise + * NODE_BLOOM. See BIP35. */ bool m_send_mempool GUARDED_BY(m_tx_inventory_mutex){false}; /** The last time a BIP35 `mempool` request was serviced. */ std::atomic m_last_mempool_req{0s}; @@ -4726,6 +4727,8 @@ void PeerManagerImpl::ProcessMessage( } if (msg_type == NetMsgType::MEMPOOL) { + // Only process received mempool messages if we advertise NODE_BLOOM + // or if the peer has mempool permissions. if (!(peer->m_our_services & NODE_BLOOM) && !pfrom.HasPermission(NetPermissionFlags::Mempool)) { if (!pfrom.HasPermission(NetPermissionFlags::NoBan))