From 09e41cc9f2605681c276d8f769bf137569ab6560 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20D=C3=A9saulniers?= <sim.desaulniers@gmail.com>
Date: Tue, 18 Oct 2016 14:20:43 -0400
Subject: [PATCH] dht: appropriate time info in permanent put ops

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

diff --git a/src/dht.cpp b/src/dht.cpp
index 8f8e955d..0950bd15 100644
--- a/src/dht.cpp
+++ b/src/dht.cpp
@@ -1282,7 +1282,7 @@ void Dht::searchSendAnnounceValue(const std::shared_ptr<Search>& sr) {
                                     sn->acked[a.value->id] = network_engine.sendAnnounceValue(sn->node,
                                                                     sr->id,
                                                                     a.value,
-                                                                    a.created,
+                                                                    a.permanent ? time_point::max() : a.created,
                                                                     sn->token,
                                                                     onDone,
                                                                     onExpired);
@@ -2209,7 +2209,7 @@ Dht::storageStore(const InfoHash& id, const std::shared_ptr<Value>& value, time_
     const auto& now = scheduler.time();
     created = std::min(created, now);
 
-    if ( created + getType(value->id).expiration < clock::now() )
+    if (created + getType(value->id).expiration < clock::now())
         return false;
 
     auto st = store.find(id);
-- 
GitLab