diff options
| author | Gregory Maxwell <[email protected]> | 2015-11-23 01:54:23 +0000 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2015-11-23 01:54:23 +0000 |
| commit | ebb25f4c23adbcb55796c402bafd6064a136f16f (patch) | |
| tree | 4f9ccbb6e0e8d46a47690caec79112d5726e16f6 /src/net.cpp | |
| parent | prevent peer flooding request queue for an inv (diff) | |
| download | discoin-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.cpp | 4 |
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; |