fix nodes disappearing

This commit is contained in:
Alex 2023-03-09 14:55:49 +01:00
parent 4d0424e465
commit 43eced6e9a

View file

@ -498,6 +498,12 @@ impl State {
fn read_wg_peers(&mut self, daemon: &Daemon) -> Result<()> { fn read_wg_peers(&mut self, daemon: &Daemon) -> Result<()> {
let (_, _, wg_peers) = wg_dump(&daemon.config)?; let (_, _, wg_peers) = wg_dump(&daemon.config)?;
// Clear old known endpoints if any
for (_, peer) in self.peers.iter_mut() {
peer.endpoint = None;
}
for (pk, endpoint, last_seen) in wg_peers { for (pk, endpoint, last_seen) in wg_peers {
match self.peers.get_mut(&pk) { match self.peers.get_mut(&pk) {
Some(i) => { Some(i) => {