Skip to content
Snippets Groups Projects
Commit fc70a891 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dht use proper value type to compute expiration

parent 343fbe62
Branches
Tags
No related merge requests found
......@@ -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()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment