Disable route when removing peer (#582)

This commit is contained in:
Misha Bragin 2022-11-25 18:11:07 +01:00 committed by GitHub
parent a78fd69f80
commit fcf7786a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,6 +252,14 @@ func (a *Account) DeletePeer(peerPubKey string) {
}
}
}
for _, r := range a.Routes {
if r.Peer == peerPubKey {
r.Enabled = false
r.Peer = ""
}
}
delete(a.Peers, peerPubKey)
a.Network.IncSerial()
}