diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-08-18 20:21:06 -0700 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2013-08-20 02:27:26 -0700 |
commit | 37c6389c5a0ca63ae3573440ecdfe95d28ad8f07 (patch) | |
tree | 51ef4367b16dc75bd60d4de0da261b65cebf4f2d /src/main.cpp | |
parent | 4bc9a192696273c88966c39debf8d17f16ebe471 (diff) | |
download | bitcoin-37c6389c5a0ca63ae3573440ecdfe95d28ad8f07.tar.xz |
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 2ccd5131d1..b62f107b4c 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; } |