From fc70a8911be7221e000b7ceec168f81ab3b80720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Sun, 23 Oct 2016 14:58:15 -0400 Subject: [PATCH] dht use proper value type to compute expiration --- src/dht.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dht.cpp b/src/dht.cpp index 7a73ca89..1d9e83b9 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -1671,8 +1671,10 @@ 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 < now) + if (created + getType(value->type).expiration < now) { + DHT_LOG.WARN("[store %s] won't store already expired value", id.toString().c_str()); return false; + } auto st = findStorage(id); if (st == store.end()) { -- GitLab