diff options
author | Peter Todd <pete@petertodd.org> | 2015-07-20 04:43:34 +0900 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2015-07-27 18:38:49 +0200 |
commit | d2d7ee0e863b286e1c9f9c54659d494fb0a7712d (patch) | |
tree | b955db39fbb776cb59777a1ac171b4cd842496ec /src/net.cpp | |
parent | a3d65fedaa18686f0cc007d0a13dba6545250300 (diff) |
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.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 3cece520de..176fd7195b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2060,7 +2060,7 @@ unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); } CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNameIn, bool fInboundIn) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), - addrKnown(5000, 0.001, insecure_rand()), + addrKnown(5000, 0.001), setInventoryKnown(SendBufferSize() / 1000) { nServices = 0; |