write peer storage test + fix loading
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-05-28 18:39:32 +02:00
parent 78a8b797e6
commit e9624e4576
3 changed files with 50 additions and 57 deletions

View File

@ -134,7 +134,7 @@ func (ps *PeerStorage) LoadPeers(password string) ([]*Peer, error) {
}
return json.Unmarshal(jsonsrv, &sc)
})
if err != nil {
if err == nil {
peers = append(peers, &sc)
ps.cache[sc.Uid] = &sc
}