Merge pull request #21 from libp2p/feat/variable-ttls

make it possible to modify non-permanent TTLs
This commit is contained in:
Steven Allen 2018-01-05 21:07:24 +00:00 committed by GitHub
commit 006e2c92f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ import (
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
) )
const ( var (
// TempAddrTTL is the ttl used for a short lived address // TempAddrTTL is the ttl used for a short lived address
TempAddrTTL = time.Second * 10 TempAddrTTL = time.Second * 10
@ -30,7 +30,8 @@ const (
OwnObservedAddrTTL = time.Minute * 10 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 ( const (
// PermanentAddrTTL is the ttl for a "permanent address" (e.g. bootstrap nodes). // PermanentAddrTTL is the ttl for a "permanent address" (e.g. bootstrap nodes).
PermanentAddrTTL = math.MaxInt64 - iota PermanentAddrTTL = math.MaxInt64 - iota