Actually track whether user can connect each day

This commit is contained in:
Vecna 2024-06-23 21:14:39 -04:00
parent c30ab6a0b4
commit 4f66b01ed3
1 changed files with 6 additions and 0 deletions

View File

@ -384,6 +384,10 @@ impl User {
) -> Result<Vec<User>> {
// 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