From 4f66b01ed3382fb9f7a68140646a79bec5d30f01 Mon Sep 17 00:00:00 2001 From: Vecna Date: Sun, 23 Jun 2024 21:14:39 -0400 Subject: [PATCH] Actually track whether user can connect each day --- src/user.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/user.rs b/src/user.rs index 02c08c1..b44ea3b 100644 --- a/src/user.rs +++ b/src/user.rs @@ -384,6 +384,10 @@ impl User { ) -> Result> { // Probabilistically decide if the user should use bridges today if event_happens(self.prob_use_bridges) { + // Start with the assumption that we can't connect, change + // only if we can + self.able_to_connect = false; + // Download bucket to see if bridge is still reachable. (We // assume that this step can be done even if the user can't // actually talk to the LA.) @@ -438,6 +442,7 @@ impl User { .unwrap(), &censor, ) { + self.able_to_connect = true; succeeded.push(bucket[i]); } else { failed.push(bucket[i]); @@ -485,6 +490,7 @@ impl User { // Attempt to connect to second cred's bridge if Self::connect(self.in_censorship_range, &config, bridge, censor) { + self.able_to_connect = true; succeeded.push(bridgeline); if second_reachcred.is_some() && eligible_for_trust_promotion(&config.la_net, &second_cred).await