diff options
| author | Gregory Maxwell <[email protected]> | 2015-11-29 22:10:31 +0000 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2015-11-30 12:53:48 +0100 |
| commit | d41e44c9accb3df84e0abbc602cc76b72754d382 (patch) | |
| tree | 6c37aa940a06d692aa022e2647703e5fec969bcc /src/main.cpp | |
| parent | Only use filterInventoryKnown with MSG_TX inventory messages. (diff) | |
| download | discoin-d41e44c9accb3df84e0abbc602cc76b72754d382.tar.xz discoin-d41e44c9accb3df84e0abbc602cc76b72754d382.zip | |
Actually only use filterInventoryKnown with MSG_TX inventory messages.
Previously this logic could erroneously filter a MSG_BLOCK inventory message.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index 98457d31e..238e2276c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5510,7 +5510,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) vInvWait.reserve(pto->vInventoryToSend.size()); BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend) { - if (pto->filterInventoryKnown.contains(inv.hash)) + if (inv.type == MSG_TX && pto->filterInventoryKnown.contains(inv.hash)) continue; // trickle out tx inv to protect privacy @@ -5531,15 +5531,13 @@ bool SendMessages(CNode* pto, bool fSendTrickle) } } - if (!pto->filterInventoryKnown.contains(inv.hash)) + pto->filterInventoryKnown.insert(inv.hash); + + vInv.push_back(inv); + if (vInv.size() >= 1000) { - pto->filterInventoryKnown.insert(inv.hash); - vInv.push_back(inv); - if (vInv.size() >= 1000) - { - pto->PushMessage("inv", vInv); - vInv.clear(); - } + pto->PushMessage("inv", vInv); + vInv.clear(); } } pto->vInventoryToSend = vInvWait; |