Skip to content

Commit 890f9e8

Browse files
committed
gw: Update reg_time when wg pubkey changed
1 parent e8fc392 commit 890f9e8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

gateway/src/main_service.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,12 @@ impl ProxyState {
816816
return None;
817817
}
818818
if let Some(existing) = self.state.instances.get_mut(id) {
819-
if existing.public_key != public_key {
819+
let pubkey_changed = existing.public_key != public_key;
820+
if pubkey_changed {
820821
info!("public key changed for instance {id}, new key: {public_key}");
821822
existing.public_key = public_key.to_string();
823+
// Update reg_time so other nodes will pick up the change
824+
existing.reg_time = SystemTime::now();
822825
}
823826
let existing = existing.clone();
824827
if self.valid_ip(existing.ip) {

0 commit comments

Comments
 (0)