mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-02-04 06:00:10 +08:00
Merge pull request #21 from libp2p/feat/variable-ttls
make it possible to modify non-permanent TTLs
This commit is contained in:
commit
006e2c92f1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user