MCPcopy Create free account
hub / github.com/encodeous/nylon / GetNeighbour

Method GetNeighbour

state/routing.go:136–144  ·  view source on GitHub ↗
(node NodeId)

Source from the content-addressed store, hash-verified

134}
135
136func (s *RouterState) GetNeighbour(node NodeId) *Neighbour {
137 nIdx := slices.IndexFunc(s.Neighbours, func(neighbour *Neighbour) bool {
138 return neighbour.Id == node
139 })
140 if nIdx == -1 {
141 return nil
142 }
143 return s.Neighbours[nIdx]
144}

Calls

no outgoing calls