From babfed73f3865b98415b4bb1876edd630f0ada61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20D=C3=A9saulniers?= <sim.desaulniers@gmail.com>
Date: Mon, 22 Aug 2016 15:32:47 -0400
Subject: [PATCH] dht: use SearchNode::acked for next announce time

---
 src/dht.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dht.cpp b/src/dht.cpp
index 10656b0e..3b5e11df 100644
--- a/src/dht.cpp
+++ b/src/dht.cpp
@@ -404,7 +404,9 @@ struct Dht::SearchNode {
         if ((ack == acked.cend() or not ack->second) and (gs == getStatus.cend()
                                                           or not gs->second or not gs->second->pending()))
             return time_point::min();
-        return gs->second->pending() ? time_point::max() : gs->second->reply_time + type.expiration - REANNOUNCE_MARGIN;
+        return (ack == acked.cend() or not ack->second or ack->second->pending()) ?
+                time_point::max() :
+                ack->second->reply_time + type.expiration - REANNOUNCE_MARGIN;
     }
 
     /**
-- 
GitLab