Generate tp_bridge_infos initially and whenever syncing with rdsys

This commit is contained in:
Vecna 2024-03-15 16:44:32 -04:00
parent daeeb3fdea
commit 64ada23f21
2 changed files with 9 additions and 3 deletions

View File

@ -67,6 +67,8 @@ impl LoxServerContext {
for bucket in open_invitations { for bucket in open_invitations {
self.add_openinv_bucket(*bucket) self.add_openinv_bucket(*bucket)
} }
self.generate_tp_bridge_infos();
} }
pub fn handle_working_resources( pub fn handle_working_resources(
@ -244,6 +246,9 @@ impl LoxServerContext {
} }
} }
} }
// Regenerate tables for verifying TP reports
self.generate_tp_bridge_infos();
} }
pub fn append_extra_bridges(&self, bridge: BridgeLine) { pub fn append_extra_bridges(&self, bridge: BridgeLine) {
@ -343,7 +348,8 @@ impl LoxServerContext {
ba_obj.bridge_update(&bridgeline) ba_obj.bridge_update(&bridgeline)
} }
pub fn generate_bridge_verification_infos(&self) { // (Re)generate the information needed to verify Troll Patrol reports
pub fn generate_tp_bridge_infos(&self) {
let la_obj = self.ba.lock().unwrap(); let la_obj = self.ba.lock().unwrap();
// Recompute table // Recompute table

View File

@ -233,7 +233,7 @@ mod tests {
let cred = get_new_credential(&mut th).await; let cred = get_new_credential(&mut th).await;
let cred = level_up(&mut th, &cred).await; let cred = level_up(&mut th, &cred).await;
th.context.generate_bridge_verification_infos(); th.context.generate_tp_bridge_infos();
let mut ba = th.context.ba.lock().unwrap(); let mut ba = th.context.ba.lock().unwrap();
@ -344,7 +344,7 @@ mod tests {
let cred = level_up(&mut th, &cred).await; let cred = level_up(&mut th, &cred).await;
let cred = level_up(&mut th, &cred).await; let cred = level_up(&mut th, &cred).await;
th.context.generate_bridge_verification_infos(); th.context.generate_tp_bridge_infos();
let mut ba = th.context.ba.lock().unwrap(); let mut ba = th.context.ba.lock().unwrap();