Small clean up and move ping to client.go

Former-commit-id: af33218792
This commit is contained in:
Owen
2026-01-15 14:20:12 -08:00
parent 3710880ce0
commit 9dcc0796a6
4 changed files with 13 additions and 21 deletions

View File

@@ -216,15 +216,15 @@ func (o *Olm) handleSync(msg websocket.WSMessage) {
return
}
var wgData WgData
if err := json.Unmarshal(jsonData, &wgData); err != nil {
var syncData SyncData
if err := json.Unmarshal(jsonData, &syncData); err != nil {
logger.Error("Error unmarshaling sync data: %v", err)
return
}
// Build a map of expected peers from the incoming data
expectedPeers := make(map[int]peers.SiteConfig)
for _, site := range wgData.Sites {
for _, site := range syncData.Sites {
expectedPeers[site.SiteId] = site
}