diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-08-18 20:21:06 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-08-21 08:49:00 +1000 |
commit | ac7c9600671322847fcce2089d43736112ff3dc2 (patch) | |
tree | 71d69be0d33a73c30aacdd57a93b7141d75f0893 /src/main.cpp | |
parent | 980b1c3571788841c0725a2708f05b8079106783 (diff) |
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 73672eed69..36471d7d98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3675,6 +3675,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; } @@ -3704,7 +3705,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; } |