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

Function buildSeqnos

core/ipc_handler.go:166–178  ·  view source on GitHub ↗
(n *Nylon)

Source from the content-addressed store, hash-verified

164}
165
166func buildSeqnos(n *Nylon) []*protocol.SeqnoEntry {
167 entries := make([]*protocol.SeqnoEntry, 0, len(n.RouterState.SelfSeqno))
168 for prefix, seqno := range n.RouterState.SelfSeqno {
169 entries = append(entries, &protocol.SeqnoEntry{
170 Prefix: prefix.String(),
171 Seqno: uint32(seqno),
172 })
173 }
174 slices.SortFunc(entries, func(a, b *protocol.SeqnoEntry) int {
175 return cmp.Compare(a.Prefix, b.Prefix)
176 })
177 return entries
178}
179
180func buildNeighbours(n *Nylon, wgStats map[state.NyPublicKey]device.PeerStatus) []*protocol.NeighbourInfo {
181 ids := slices.Clone(n.GetPeers(n.LocalCfg.Id))

Callers 1

handleStatusFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected