handle case where NAT traversing relay peer is not recognized by peer store

This commit is contained in:
Cassandra Heart 2023-09-29 04:03:21 -05:00
parent 1a009e3769
commit 263ea5cba8
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -306,6 +306,11 @@ func (b *BlossomSub) GetNetworkPeersCount() int {
} }
func (b *BlossomSub) GetMultiaddrOfPeer(peerId []byte) string { func (b *BlossomSub) GetMultiaddrOfPeer(peerId []byte) string {
addrs := b.h.Peerstore().Addrs(peer.ID(peerId))
if len(addrs) == 0 {
return ""
}
return b.h.Peerstore().Addrs(peer.ID(peerId))[0].String() return b.h.Peerstore().Addrs(peer.ID(peerId))[0].String()
} }