delete peer cache fix
continuous-integration/drone/push Build is failing

This commit is contained in:
yc
2026-04-18 20:40:23 +02:00
parent 00e4e6b046
commit a5dd6cd73f
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -109,9 +109,13 @@ func (ps *PeerStorage) DeletePeer(uid string) error {
defer ps.close()
shakey := sha256.Sum256([]byte(uid))
key := shakey[:]
return ps.db.Update(func(txn *badger.Txn) error {
err = ps.db.Update(func(txn *badger.Txn) error {
return txn.Delete(key)
})
if err == nil {
delete(ps.cache, uid)
}
return err
}
// LoadPeers function loads Peers from the badger database with a specific password