Add sync check for unallocated_bridges in lox-library

This commit is contained in:
onyinyang 2024-03-12 15:31:40 -04:00
parent 76bb8757f5
commit 8e08adbdb0
No known key found for this signature in database
GPG Key ID: 156A6435430C2036
1 changed files with 11 additions and 0 deletions

View File

@ -511,6 +511,17 @@ impl BridgeAuth {
return res;
}
}
// Also check the unallocated bridges just in case there is a bridge that should be updated there
let unallocated_bridges = self.bridge_table.unallocated_bridges.clone();
for (i, unallocated_bridge) in unallocated_bridges.iter().enumerate() {
if unallocated_bridge.uid_fingerprint == bridge.uid_fingerprint {
// Now we must remove the old bridge from the unallocated bridges and insert the new bridge
// in its place
self.bridge_table.unallocated_bridges.remove(i);
self.bridge_table.unallocated_bridges.push(*bridge);
res = true;
}
}
// If this is returned, we assume that the bridge wasn't found in the bridge table
// and therefore should be treated as a "new bridge"
res