[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
pull/764/head
gzhao408 4 years ago
parent b33136b6ba
commit 1c6b787e03

@ -3490,13 +3490,15 @@ bool ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRec
}
if (msg_type == NetMsgType::FILTERCLEAR) {
if (!(pfrom.GetLocalServices() & NODE_BLOOM)) {
pfrom.fDisconnect = true;
return true;
}
if (pfrom.m_tx_relay == nullptr) {
return true;
}
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;
return true;
}

Loading…
Cancel
Save