From 37c6389c5a0ca63ae3573440ecdfe95d28ad8f07 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 18 Aug 2013 20:21:06 -0700 Subject: Performance optimization for bloom filters. This reduces a peer's ability to attack network resources by using a full bloom filter, but without reducing the usability of bloom filters. It sets a default match everything filter for peers and it generalizes a prior optimization to cover more cases. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2ccd5131d..b62f107b4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3893,6 +3893,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) LOCK(pfrom->cs_filter); delete pfrom->pfilter; pfrom->pfilter = new CBloomFilter(filter); + filter.UpdateEmptyFull(); } pfrom->fRelayTxes = true; } @@ -3922,7 +3923,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) { LOCK(pfrom->cs_filter); delete pfrom->pfilter; - pfrom->pfilter = NULL; + pfrom->pfilter = new CBloomFilter(); pfrom->fRelayTxes = true; } -- cgit v1.2.3