internal: various cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I48f7eac2e99d1d2af02fcf237401be096a6a6964
This commit is contained in:
parent
0ca9d5b615
commit
56e1935ead
6 changed files with 33 additions and 48 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue