Skip to content

Commit d41e44c

Browse files
gmaxwellsipa
authored andcommitted
Actually only use filterInventoryKnown with MSG_TX inventory messages.
Previously this logic could erroneously filter a MSG_BLOCK inventory message.
1 parent b6a0da4 commit d41e44c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/main.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5510,7 +5510,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
55105510
vInvWait.reserve(pto->vInventoryToSend.size());
55115511
BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)
55125512
{
5513-
if (pto->filterInventoryKnown.contains(inv.hash))
5513+
if (inv.type == MSG_TX && pto->filterInventoryKnown.contains(inv.hash))
55145514
continue;
55155515

55165516
// trickle out tx inv to protect privacy
@@ -5531,15 +5531,13 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
55315531
}
55325532
}
55335533

5534-
if (!pto->filterInventoryKnown.contains(inv.hash))
5534+
pto->filterInventoryKnown.insert(inv.hash);
5535+
5536+
vInv.push_back(inv);
5537+
if (vInv.size() >= 1000)
55355538
{
5536-
pto->filterInventoryKnown.insert(inv.hash);
5537-
vInv.push_back(inv);
5538-
if (vInv.size() >= 1000)
5539-
{
5540-
pto->PushMessage("inv", vInv);
5541-
vInv.clear();
5542-
}
5539+
pto->PushMessage("inv", vInv);
5540+
vInv.clear();
55435541
}
55445542
}
55455543
pto->vInventoryToSend = vInvWait;

0 commit comments

Comments
 (0)