aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgzhao408 <gzhao408@berkeley.edu>2020-06-03 16:28:43 -0700
committergzhao408 <gzhao408@berkeley.edu>2020-06-14 11:47:12 -0700
commit1c6b787e0319c44f0e0bede3f4a77ac7c2089db2 (patch)
tree5a5289253d5cce1cbe2634e0113136929e7ec9d4
parentb33136b6ba9887f7db651c4c5264ca7f2f601df7 (diff)
[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
-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 d48745aef2..8e8a84e4e2 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;
}