aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorgzhao408 <[email protected]>2020-06-03 16:28:43 -0700
committergzhao408 <[email protected]>2020-06-14 11:47:12 -0700
commit1c6b787e0319c44f0e0bede3f4a77ac7c2089db2 (patch)
tree5a5289253d5cce1cbe2634e0113136929e7ec9d4 /src/net_processing.cpp
parentMerge #19083: test: msg_mempool, fRelay, and other bloomfilter tests (diff)
downloaddiscoin-1c6b787e0319c44f0e0bede3f4a77ac7c2089db2.tar.xz
discoin-1c6b787e0319c44f0e0bede3f4a77ac7c2089db2.zip
[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
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index d48745aef..8e8a84e4e 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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;
}