aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp
index cff4c54505..04119e9ddd 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2410,6 +2410,10 @@ void CNode::AskFor(const CInv& inv)
{
if (mapAskFor.size() > MAPASKFOR_MAX_SZ)
return;
+ // a peer may not occupy multiple positions in an inv's request queue
+ if (!setAskFor.insert(inv.hash).second)
+ return;
+
// We're using mapAskFor as a priority queue,
// the key is the earliest time the request can be sent
int64_t nRequestTime;