From bd822fce1998a88afdde1823c2ae27a74af1d449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Tue, 17 Jan 2017 16:43:32 -0500 Subject: [PATCH] dht: don't stop node insertion on expired search --- src/dht.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dht.cpp b/src/dht.cpp index 970d8e23..90954688 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -879,7 +879,7 @@ Dht::trySearchInsert(const std::shared_ptr<Node>& node) if (s.insertNode(node, now)) { inserted = true; scheduler.edit(s.nextSearchStep, s.getNextStepTime(now)); - } else + } else if (not s.expired and not s.done) break; ++it; } @@ -891,7 +891,7 @@ Dht::trySearchInsert(const std::shared_ptr<Node>& node) if (s.insertNode(node, now)) { inserted = true; scheduler.edit(s.nextSearchStep, s.getNextStepTime(now)); - } else + } else if (not s.expired and not s.done) break; } return inserted; -- GitLab