@cryptotaxi247 / kubo / commits / b558012d2

namesys: fix length of self resolve cache

License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Dec 13, 2016 at 20:58 UTC b558012d27a72e20f6d3d5096f0f7c27ccd8f77f
1 file changed +3
namesys/namesys.go
+3
@@ -125,6 +125,9 @@ func (ns *mpns) addToDHTCache(key ci.PrivKey, value path.Path, eol time.Time) {
125 // should never happen, purely for sanity
126 log.Panicf("unexpected type %T as DHT resolver.", ns.resolvers["dht"])
127 }
128 + if time.Now().Add(DefaultResolverCacheTTL).Before(eol) {
129 + eol = time.Now().Add(DefaultResolverCacheTTL)
130 + }
131 rr.cache.Add(name.Pretty(), cacheEntry{
132 val: value,
133 eol: eol,