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 Fuzzbawls committed Jun 23, 2020
1 parent 4f11eb2 commit 01273db
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 @@ -6397,7 +6397,7 @@ bool SendMessages(CNode* pto)
vInv.reserve(pto->vInventoryToSend.size());
vInvWait.reserve(pto->vInventoryToSend.size());
for (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 @@ -6416,8 +6416,8 @@ bool SendMessages(CNode* pto)
}
}

if (!pto->setInventoryKnown.contains(inv.hash)) {
pto->setInventoryKnown.insert(inv.hash);
if (!pto->filterInventoryKnown.contains(inv.hash)) {
pto->filterInventoryKnown.insert(inv.hash);
vInv.push_back(inv);
if (vInv.size() >= 1000) {
pto->PushMessage(NetMsgType::INV, vInv);
Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,7 @@ unsigned int SendBufferSize() { return 1000 * GetArg("-maxsendbuffer", 1 * 1000)
CNode::CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn, bool fInboundIn) :
ssSend(SER_NETWORK, INIT_PROTO_VERSION),
addrKnown(5000, 0.001),
setInventoryKnown(50000, 0.000001)
filterInventoryKnown(50000, 0.000001)
{
nServices = NODE_NONE;
nServicesExpected = NODE_NONE;
Expand Down Expand Up @@ -2347,7 +2347,7 @@ CNode::CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn, bool fIn
nSendOffset = 0;
hashContinue = UINT256_ZERO;
nStartingHeight = -1;
setInventoryKnown.reset();
filterInventoryKnown.reset();
fGetAddr = false;
nNextLocalAddrSend = 0;
nNextAddrSend = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class CNode
int64_t nNextLocalAddrSend;

// inventory based relay
CRollingBloomFilter setInventoryKnown;
CRollingBloomFilter filterInventoryKnown;
std::vector<CInv> vInventoryToSend;
RecursiveMutex cs_inventory;
std::multimap<int64_t, CInv> mapAskFor;
Expand Down Expand Up @@ -486,15 +486,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 01273db

Please sign in to comment.