mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-26 22:25:52 -05:00
Check that peers are registered when fetching them
Fix from https://github.com/awsong/headscale
This commit is contained in:
parent
b0b9e3a9af
commit
acb645aa9d
@ -107,7 +107,7 @@ func (h *Headscale) getPeers(m Machine) (*[]*tailcfg.Node, error) {
|
|||||||
|
|
||||||
// Add user management here?
|
// Add user management here?
|
||||||
machines := []Machine{}
|
machines := []Machine{}
|
||||||
if err = db.Where("machine_key <> ?", m.MachineKey).Find(&machines).Error; err != nil {
|
if err = db.Where("machine_key <> ? AND registered", m.MachineKey).Find(&machines).Error; err != nil {
|
||||||
log.Printf("Error accessing db: %s", err)
|
log.Printf("Error accessing db: %s", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user