aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <[email protected]>2015-11-23 01:54:23 +0000
committerGregory Maxwell <[email protected]>2015-11-23 01:54:23 +0000
commitebb25f4c23adbcb55796c402bafd6064a136f16f (patch)
tree4f9ccbb6e0e8d46a47690caec79112d5726e16f6 /src/net.cpp
parentprevent peer flooding request queue for an inv (diff)
downloaddiscoin-ebb25f4c23adbcb55796c402bafd6064a136f16f.tar.xz
discoin-ebb25f4c23adbcb55796c402bafd6064a136f16f.zip
Limit setAskFor and retire requested entries only when a getdata returns.
The setAskFor duplicate elimination was too eager and removed entries when we still had no getdata response, allowing the peer to keep INVing and not responding.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 04119e9dd..a8b6ca9c5 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2408,9 +2408,9 @@ CNode::~CNode()
void CNode::AskFor(const CInv& inv)
{
- if (mapAskFor.size() > MAPASKFOR_MAX_SZ)
+ if (mapAskFor.size() > MAPASKFOR_MAX_SZ || setAskFor.size() > SETASKFOR_MAX_SZ)
return;
- // a peer may not occupy multiple positions in an inv's request queue
+ // a peer may not have multiple non-responded queue positions for a single inv item
if (!setAskFor.insert(inv.hash).second)
return;