Set online status in lite requests (#1555)

This commit is contained in:
Kristoffer Dalby
2023-09-25 14:27:14 -07:00
committed by GitHub
parent 84fbca97f7
commit 64c0a6523f
3 changed files with 14 additions and 15 deletions

View File

@@ -70,6 +70,16 @@ type (
Nodes []*Node
)
func (nodes Nodes) OnlineNodeMap() map[tailcfg.NodeID]bool {
ret := make(map[tailcfg.NodeID]bool)
for _, node := range nodes {
ret[tailcfg.NodeID(node.ID)] = node.IsOnline()
}
return ret
}
type NodeAddresses []netip.Addr
func (na NodeAddresses) Sort() {