Skip to content

Commit

Permalink
dht use proper value type to compute expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
aberaud committed Oct 23, 2016
1 parent 343fbe6 commit fc70a89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dht.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit fc70a89

Please sign in to comment.