internal: various cleanup

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I48f7eac2e99d1d2af02fcf237401be096a6a6964
This commit is contained in:
raf 2026-05-09 13:24:46 +03:00
commit 56e1935ead
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
6 changed files with 33 additions and 48 deletions

View file

@ -140,9 +140,11 @@ func RunGossipLoop(node *Node, src RouteSource, peers []string, interval time.Du
continue
}
for _, peer := range peers {
if err := Announce(peer, node, routes); err != nil {
slog.Warn("mesh: announce failed", "peer", peer, "error", err)
}
go func(p string) {
if err := Announce(p, node, routes); err != nil {
slog.Warn("mesh: announce failed", "peer", p, "error", err)
}
}(peer)
}
slog.Debug("mesh: announced routes to peers", "routes", len(routes), "peers", len(peers))
}

View file

@ -150,10 +150,3 @@ func (rs *RouteStore) Top(n int) []cache.RouteEntry {
}
return result
}
func min(a, b int) int {
if a < b {
return a
}
return b
}