Browse Source

Rename setInventoryKnown filterInventoryKnown

0.13
Patick Strateman 9 years ago committed by Pieter Wuille
parent
commit
6b849350ab
  1. 6
      src/main.cpp
  2. 4
      src/net.cpp
  3. 6
      src/net.h

6
src/main.cpp

@ -5510,7 +5510,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) @@ -5510,7 +5510,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
vInvWait.reserve(pto->vInventoryToSend.size());
BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)
{
if (pto->setInventoryKnown.contains(inv.hash))
if (pto->filterInventoryKnown.contains(inv.hash))
continue;
// trickle out tx inv to protect privacy
@ -5531,9 +5531,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle) @@ -5531,9 +5531,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
}
}
if (!pto->setInventoryKnown.contains(inv.hash))
if (!pto->filterInventoryKnown.contains(inv.hash))
{
pto->setInventoryKnown.insert(inv.hash);
pto->filterInventoryKnown.insert(inv.hash);
vInv.push_back(inv);
if (vInv.size() >= 1000)
{

4
src/net.cpp

@ -2342,7 +2342,7 @@ unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", DEFAULT_MAX @@ -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(50000, 0.000001)
filterInventoryKnown(50000, 0.000001)
{
nServices = 0;
hSocket = hSocketIn;
@ -2369,7 +2369,7 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa @@ -2369,7 +2369,7 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa
nSendOffset = 0;
hashContinue = uint256();
nStartingHeight = -1;
setInventoryKnown.reset();
filterInventoryKnown.reset();
fGetAddr = false;
fRelayTxes = false;
pfilter = new CBloomFilter();

6
src/net.h

@ -385,7 +385,7 @@ public: @@ -385,7 +385,7 @@ public:
std::set<uint256> setKnown;
// inventory based relay
CRollingBloomFilter setInventoryKnown;
CRollingBloomFilter filterInventoryKnown;
std::vector<CInv> vInventoryToSend;
CCriticalSection cs_inventory;
std::multimap<int64_t, CInv> mapAskFor;
@ -493,7 +493,7 @@ public: @@ -493,7 +493,7 @@ public:
{
{
LOCK(cs_inventory);
setInventoryKnown.insert(inv.hash);
filterInventoryKnown.insert(inv.hash);
}
}
@ -501,7 +501,7 @@ public: @@ -501,7 +501,7 @@ public:
{
{
LOCK(cs_inventory);
if (!setInventoryKnown.contains(inv.hash))
if (!filterInventoryKnown.contains(inv.hash))
vInventoryToSend.push_back(inv);
}
}

Loading…
Cancel
Save