mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-03-22 12:20:07 +08:00
add method to peerstore to retrieve signed routing records
This commit is contained in:
parent
c016eb5a80
commit
f01458e2e6
@ -96,8 +96,8 @@ type AddrBook interface {
|
|||||||
// If the manager has a longer TTL, the operation is a no-op for that address
|
// If the manager has a longer TTL, the operation is a no-op for that address
|
||||||
AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duration)
|
AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duration)
|
||||||
|
|
||||||
// AddCertifiedAddrs adds addresses from a PeerStateRecord contained
|
// AddCertifiedAddrs adds addresses from a routing.RoutingState record
|
||||||
// in the given SignedEnvelope.
|
// contained in the given SignedEnvelope.
|
||||||
AddCertifiedAddrs(envelope *ic.SignedEnvelope, ttl time.Duration) error
|
AddCertifiedAddrs(envelope *ic.SignedEnvelope, ttl time.Duration) error
|
||||||
|
|
||||||
// SetAddr calls mgr.SetAddrs(p, addr, ttl)
|
// SetAddr calls mgr.SetAddrs(p, addr, ttl)
|
||||||
@ -129,6 +129,10 @@ type AddrBook interface {
|
|||||||
|
|
||||||
// PeersWithAddrs returns all of the peer IDs stored in the AddrBook
|
// PeersWithAddrs returns all of the peer IDs stored in the AddrBook
|
||||||
PeersWithAddrs() peer.IDSlice
|
PeersWithAddrs() peer.IDSlice
|
||||||
|
|
||||||
|
// SignedRoutingState returns a SignedEnvelope containing a RoutingState
|
||||||
|
// record, if one exists for the given peer.
|
||||||
|
SignedRoutingState(p peer.ID) *ic.SignedEnvelope
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeyBook tracks the keys of Peers.
|
// KeyBook tracks the keys of Peers.
|
||||||
|
Loading…
Reference in New Issue
Block a user