aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2015-11-26 05:25:30 +0000
committerPieter Wuille <pieter.wuille@gmail.com>2015-11-30 12:53:48 +0100
commitec73ef37eccfeda76de55c4ff93ea54d4e69e1ec (patch)
treefee5ec5cdc8537bb6bd84d92ab9edd0d7fb1cdd5 /src/net.cpp
parenta7751824ce8a7e1cc5511794516fe674bc3eaa3c (diff)
downloadbitcoin-ec73ef37eccfeda76de55c4ff93ea54d4e69e1ec.tar.xz
Replace setInventoryKnown with a rolling bloom filter.
Mruset setInventoryKnown was reduced to a remarkably small 1000 entries as a side effect of sendbuffer size reductions in 2012. This removes setInventoryKnown filtering from merkleBlock responses because false positives there are especially unattractive and also because I'm not sure if there aren't race conditions around the relay pool that would cause some transactions there to be suppressed. (Also, ProcessGetData was accessing setInventoryKnown without taking the required lock.)
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index abc7cbb8f4..fc8fa30eee 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2342,7 +2342,7 @@ unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", DEFAULT_MAX
CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNameIn, bool fInboundIn) :
ssSend(SER_NETWORK, INIT_PROTO_VERSION),
addrKnown(5000, 0.001),
- setInventoryKnown(SendBufferSize() / 1000)
+ setInventoryKnown(50000, 0.000001)
{
nServices = 0;
hSocket = hSocketIn;
@@ -2369,6 +2369,7 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa
nSendOffset = 0;
hashContinue = uint256();
nStartingHeight = -1;
+ setInventoryKnown.reset();
fGetAddr = false;
fRelayTxes = false;
pfilter = new CBloomFilter();