From 4528eacfbfe051e06768ef14b65adf643b1794c0 Mon Sep 17 00:00:00 2001 From: Yusef Napora Date: Fri, 8 Nov 2019 11:42:59 -0500 Subject: [PATCH] add method to peerstore to retrieve signed routing records --- peerstore/peerstore.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/peerstore/peerstore.go b/peerstore/peerstore.go index 399b6fe..ed45f38 100644 --- a/peerstore/peerstore.go +++ b/peerstore/peerstore.go @@ -96,8 +96,8 @@ type AddrBook interface { // 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) - // AddCertifiedAddrs adds addresses from a PeerStateRecord contained - // in the given SignedEnvelope. + // AddCertifiedAddrs adds addresses from a routing.RoutingState record + // contained in the given SignedEnvelope. AddCertifiedAddrs(envelope *ic.SignedEnvelope, ttl time.Duration) error // 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() 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.