helpers.go 257 Bytes
Newer Older
1 2
package host

tavit ohanian's avatar
tavit ohanian committed
3
import "gitlab.dms3.io/p2p/go-p2p-core/peer"
4 5 6 7 8 9 10 11

// InfoFromHost returns a peer.AddrInfo struct with the Host's ID and all of its Addrs.
func InfoFromHost(h Host) *peer.AddrInfo {
	return &peer.AddrInfo{
		ID:    h.ID(),
		Addrs: h.Addrs(),
	}
}