Skip to content

Commit

Permalink
Rename setInventoryKnown filterInventoryKnown
Browse files Browse the repository at this point in the history
  • Loading branch information
pstratem authored and sipa committed Nov 30, 2015
1 parent e206724 commit 6b84935
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class CNode
std::set<uint256> setKnown;

// inventory based relay
CRollingBloomFilter setInventoryKnown;
CRollingBloomFilter filterInventoryKnown;
std::vector<CInv> vInventoryToSend;
CCriticalSection cs_inventory;
std::multimap<int64_t, CInv> mapAskFor;
Expand Down Expand Up @@ -493,15 +493,15 @@ class CNode
{
{
LOCK(cs_inventory);
setInventoryKnown.insert(inv.hash);
filterInventoryKnown.insert(inv.hash);
}
}

void PushInventory(const CInv& inv)
{
{
LOCK(cs_inventory);
if (!setInventoryKnown.contains(inv.hash))
if (!filterInventoryKnown.contains(inv.hash))
vInventoryToSend.push_back(inv);
}
}
Expand Down

0 comments on commit 6b84935

Please sign in to comment.