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)
vInvWait.reserve(pto->vInventoryToSend.size()); vInvWait.reserve(pto->vInventoryToSend.size());
BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend) BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)
{ {
if (pto->setInventoryKnown.contains(inv.hash)) if (pto->filterInventoryKnown.contains(inv.hash))
continue; continue;
// trickle out tx inv to protect privacy // trickle out tx inv to protect privacy
@ -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); vInv.push_back(inv);
if (vInv.size() >= 1000) if (vInv.size() >= 1000)
{ {

4
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) : CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNameIn, bool fInboundIn) :
ssSend(SER_NETWORK, INIT_PROTO_VERSION), ssSend(SER_NETWORK, INIT_PROTO_VERSION),
addrKnown(5000, 0.001), addrKnown(5000, 0.001),
setInventoryKnown(50000, 0.000001) filterInventoryKnown(50000, 0.000001)
{ {
nServices = 0; nServices = 0;
hSocket = hSocketIn; hSocket = hSocketIn;
@ -2369,7 +2369,7 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa
nSendOffset = 0; nSendOffset = 0;
hashContinue = uint256(); hashContinue = uint256();
nStartingHeight = -1; nStartingHeight = -1;
setInventoryKnown.reset(); filterInventoryKnown.reset();
fGetAddr = false; fGetAddr = false;
fRelayTxes = false; fRelayTxes = false;
pfilter = new CBloomFilter(); pfilter = new CBloomFilter();

6
src/net.h

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

Loading…
Cancel
Save