aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-04-06 17:34:07 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-04-09 11:26:24 +0200
commit5eae034996b340c19cebab9efb6c89d20fe051ef (patch)
tree5a941edaa3b8fee4b513ca117b199057731c2799 /src/net.h
parent661bd5dea3d080cd79f15c7703fc6ab577a1aa0c (diff)
downloadbitcoin-5eae034996b340c19cebab9efb6c89d20fe051ef.tar.xz
net: limit BIP37 filter lifespan (active between 'filterload' and 'filterclear')
Previously, a default match-everything bloom filter was set for every peer, i.e. even before receiving a 'filterload' message and after receiving a 'filterclear' message code branches checking for the existence of the filter by testing the pointer "pfilter" were _always_ executed.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index a72af83eef..6594cb84c5 100644
--- a/src/net.h
+++ b/src/net.h
@@ -809,14 +809,13 @@ public:
RecursiveMutex cs_inventory;
struct TxRelay {
- TxRelay() { pfilter = MakeUnique<CBloomFilter>(); }
mutable RecursiveMutex cs_filter;
// We use fRelayTxes for two purposes -
// a) it allows us to not relay tx invs before receiving the peer's version message
// b) the peer may tell us in its version message that we should not relay tx invs
// unless it loads a bloom filter.
bool fRelayTxes GUARDED_BY(cs_filter){false};
- std::unique_ptr<CBloomFilter> pfilter PT_GUARDED_BY(cs_filter) GUARDED_BY(cs_filter);
+ std::unique_ptr<CBloomFilter> pfilter PT_GUARDED_BY(cs_filter) GUARDED_BY(cs_filter){nullptr};
mutable RecursiveMutex cs_tx_inventory;
CRollingBloomFilter filterInventoryKnown GUARDED_BY(cs_tx_inventory){50000, 0.000001};