mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 18:07:33 +00:00
Set online status in lite requests (#1555)
This commit is contained in:
@@ -635,16 +635,6 @@ func (hsdb *HSDatabase) IsRoutesEnabled(node *types.Node, routeStr string) bool
|
||||
return false
|
||||
}
|
||||
|
||||
func OnlineNodeMap(peers types.Nodes) map[tailcfg.NodeID]bool {
|
||||
ret := make(map[tailcfg.NodeID]bool)
|
||||
|
||||
for _, peer := range peers {
|
||||
ret[tailcfg.NodeID(peer.ID)] = peer.IsOnline()
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (hsdb *HSDatabase) ListOnlineNodes(
|
||||
node *types.Node,
|
||||
) (map[tailcfg.NodeID]bool, error) {
|
||||
@@ -656,7 +646,7 @@ func (hsdb *HSDatabase) ListOnlineNodes(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return OnlineNodeMap(peers), nil
|
||||
return peers.OnlineNodeMap(), nil
|
||||
}
|
||||
|
||||
// enableRoutes enables new routes based on a list of new routes.
|
||||
|
Reference in New Issue
Block a user