aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2015-05-01 11:52:09 +0200
committerWladimir J. van der Laan <[email protected]>2015-05-01 12:52:18 +0200
commitb46e7c24e58efd06f60ae0f9ab85a53283e23059 (patch)
tree1e02d1aa11957b3f40361a9994feaa567c970404 /src/main.cpp
parentMerge pull request #6022 (diff)
parentBetter mruset unit test (diff)
downloaddiscoin-b46e7c24e58efd06f60ae0f9ab85a53283e23059.tar.xz
discoin-b46e7c24e58efd06f60ae0f9ab85a53283e23059.zip
Merge pull request #6064
f46a680 Better mruset unit test (Pieter Wuille) d4d5022 Use ring buffer of set iterators instead of deque of copies in mruset (Pieter Wuille) d81cff3 Replace mruset setAddrKnown with CRollingBloomFilter addrKnown (Gavin Andresen) 69a5f8b Rolling bloom filter class (Gavin Andresen)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e6248c661..a6b717d57 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3995,7 +3995,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
{
LOCK(cs_vNodes);
// Use deterministic randomness to send to the same nodes for 24 hours
- // at a time so the setAddrKnowns of the chosen nodes prevent repeats
+ // at a time so the addrKnowns of the chosen nodes prevent repeats
static uint256 hashSalt;
if (hashSalt.IsNull())
hashSalt = GetRandHash();
@@ -4779,9 +4779,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
- // Periodically clear setAddrKnown to allow refresh broadcasts
+ // Periodically clear addrKnown to allow refresh broadcasts
if (nLastRebroadcast)
- pnode->setAddrKnown.clear();
+ pnode->addrKnown.clear();
// Rebroadcast our address
AdvertizeLocal(pnode);
@@ -4799,9 +4799,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
vAddr.reserve(pto->vAddrToSend.size());
BOOST_FOREACH(const CAddress& addr, pto->vAddrToSend)
{
- // returns true if wasn't already contained in the set
- if (pto->setAddrKnown.insert(addr).second)
+ if (!pto->addrKnown.contains(addr.GetKey()))
{
+ pto->addrKnown.insert(addr.GetKey());
vAddr.push_back(addr);
// receiver rejects addr messages larger than 1000
if (vAddr.size() >= 1000)