aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-12-03 13:14:46 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-03 13:16:46 +0100
commit8843676621556081a09b9d89ba74cbc6cf350e10 (patch)
treef0cb3d5a94c96a393da8e517ff5d9860cf4a2f41 /src/net.h
parentc12ff995f7d70aafb12f34887fb64aa7482bbc85 (diff)
parentaa4b0c26b0a94ca6164c441aae723e118554d214 (diff)
downloadbitcoin-8843676621556081a09b9d89ba74cbc6cf350e10.tar.xz
Merge pull request #7133
aa4b0c2 When not filtering blocks, getdata sends more in one test (Pieter Wuille) d41e44c Actually only use filterInventoryKnown with MSG_TX inventory messages. (Gregory Maxwell) b6a0da4 Only use filterInventoryKnown with MSG_TX inventory messages. (Patick Strateman) 6b84935 Rename setInventoryKnown filterInventoryKnown (Patick Strateman) e206724 Remove mruset as it is no longer used. (Gregory Maxwell) ec73ef3 Replace setInventoryKnown with a rolling bloom filter. (Gregory Maxwell)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net.h b/src/net.h
index a5a5c770d6..6886d070bf 100644
--- a/src/net.h
+++ b/src/net.h
@@ -9,7 +9,6 @@
#include "bloom.h"
#include "compat.h"
#include "limitedmap.h"
-#include "mruset.h"
#include "netbase.h"
#include "protocol.h"
#include "random.h"
@@ -388,7 +387,7 @@ public:
std::set<uint256> setKnown;
// inventory based relay
- mruset<CInv> setInventoryKnown;
+ CRollingBloomFilter filterInventoryKnown;
std::vector<CInv> vInventoryToSend;
CCriticalSection cs_inventory;
std::set<uint256> setAskFor;
@@ -497,7 +496,7 @@ public:
{
{
LOCK(cs_inventory);
- setInventoryKnown.insert(inv);
+ filterInventoryKnown.insert(inv.hash);
}
}
@@ -505,8 +504,9 @@ public:
{
{
LOCK(cs_inventory);
- if (!setInventoryKnown.count(inv))
- vInventoryToSend.push_back(inv);
+ if (inv.type == MSG_TX && filterInventoryKnown.contains(inv.hash))
+ return;
+ vInventoryToSend.push_back(inv);
}
}