aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2015-07-20 04:43:34 +0900
committerPeter Todd <pete@petertodd.org>2015-10-02 12:17:44 +0200
commit83671efe996f6ea695d051594acc7f5fb4c500fc (patch)
tree1834c3a7b79369af23a72367d7737b2199ba0449 /src/main.cpp
parent25cf1220e64a418420ae030091882337046fb3cf (diff)
downloadbitcoin-83671efe996f6ea695d051594acc7f5fb4c500fc.tar.xz
Make CRollingBloomFilter set nTweak for you
While CBloomFilter is usually used with an explicitly set nTweak, CRollingBloomFilter is only used internally. Requiring every caller to set nTweak is error-prone and redundant; better to have the class handle that for you with a high-quality randomness source. Additionally when clearing the filter it makes sense to change nTweak as well to recover from a bad setting, e.g. due to insufficient randomness at initialization, so the clear() method is replaced by a reset() method that sets a new, random, nTweak value. (cherry picked from commit d2d7ee0e863b286e1c9f9c54659d494fb0a7712d)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 601d72b996..8cbc049a96 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4909,7 +4909,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
{
// Periodically clear addrKnown to allow refresh broadcasts
if (nLastRebroadcast)
- pnode->addrKnown.clear();
+ pnode->addrKnown.reset();
// Rebroadcast our address
AdvertizeLocal(pnode);