1
0
mirror of https://github.com/libp2p/go-libp2p-peerstore.git synced 2025-03-25 13:20:07 +08:00

make it possible to modify non-permanent TTLs

useful for testing, at the very least.
This commit is contained in:
Steven Allen 2018-01-04 19:30:22 -08:00
parent 96cec5af5a
commit d2a1a281f2

View File

@ -12,7 +12,7 @@ import (
ma "github.com/multiformats/go-multiaddr"
)
const (
var (
// TempAddrTTL is the ttl used for a short lived address
TempAddrTTL = time.Second * 10
@ -30,7 +30,8 @@ const (
OwnObservedAddrTTL = time.Minute * 10
)
// Permanent TTLs (distinct so we can distinguish between them)
// Permanent TTLs (distinct so we can distinguish between them, constant as they
// are, in fact, permanent)
const (
// PermanentAddrTTL is the ttl for a "permanent address" (e.g. bootstrap nodes).
PermanentAddrTTL = math.MaxInt64 - iota