0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

[netprocessing] disconnect node that sends filterclear

-nodes not serving bloomfilters should disconnect peers
that send filterclear, just like filteradd and filterload
-nodes that want to enable/disable txrelay should use
feefilter
This commit is contained in:
gzhao408 2020-06-03 16:28:43 -07:00
parent b33136b6ba
commit 1c6b787e03

View file

@ -3490,13 +3490,15 @@ bool ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRec
} }
if (msg_type == NetMsgType::FILTERCLEAR) { if (msg_type == NetMsgType::FILTERCLEAR) {
if (!(pfrom.GetLocalServices() & NODE_BLOOM)) {
pfrom.fDisconnect = true;
return true;
}
if (pfrom.m_tx_relay == nullptr) { if (pfrom.m_tx_relay == nullptr) {
return true; return true;
} }
LOCK(pfrom.m_tx_relay->cs_filter); LOCK(pfrom.m_tx_relay->cs_filter);
if (pfrom.GetLocalServices() & NODE_BLOOM) { pfrom.m_tx_relay->pfilter = nullptr;
pfrom.m_tx_relay->pfilter = nullptr;
}
pfrom.m_tx_relay->fRelayTxes = true; pfrom.m_tx_relay->fRelayTxes = true;
return true; return true;
} }