MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / NetAddress

Method NetAddress

p2p/node_info.go:221–224  ·  view source on GitHub ↗

NetAddress returns a NetAddress derived from the DefaultNodeInfo - it includes the authenticated peer ID and the self-reported ListenAddr. Note that the ListenAddr is not authenticated and may not match that address actually dialed if its an outbound peer.

()

Source from the content-addressed store, hash-verified

219// ListenAddr. Note that the ListenAddr is not authenticated and
220// may not match that address actually dialed if its an outbound peer.
221func (info DefaultNodeInfo) NetAddress() (*NetAddress, error) {
222 idAddr := IDAddressString(info.ID(), info.ListenAddr)
223 return NewNetAddressString(idAddr)
224}
225
226func (info DefaultNodeInfo) HasChannel(chID byte) bool {
227 return bytes.Contains(info.Channels, []byte{chID})

Callers

nothing calls this directly

Calls 3

IDMethod · 0.95
IDAddressStringFunction · 0.85
NewNetAddressStringFunction · 0.85

Tested by

no test coverage detected