Actually track whether user can connect each day
This commit is contained in:
parent
c30ab6a0b4
commit
4f66b01ed3
|
@ -384,6 +384,10 @@ impl User {
|
||||||
) -> Result<Vec<User>> {
|
) -> Result<Vec<User>> {
|
||||||
// Probabilistically decide if the user should use bridges today
|
// Probabilistically decide if the user should use bridges today
|
||||||
if event_happens(self.prob_use_bridges) {
|
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
|
// Download bucket to see if bridge is still reachable. (We
|
||||||
// assume that this step can be done even if the user can't
|
// assume that this step can be done even if the user can't
|
||||||
// actually talk to the LA.)
|
// actually talk to the LA.)
|
||||||
|
@ -438,6 +442,7 @@ impl User {
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
&censor,
|
&censor,
|
||||||
) {
|
) {
|
||||||
|
self.able_to_connect = true;
|
||||||
succeeded.push(bucket[i]);
|
succeeded.push(bucket[i]);
|
||||||
} else {
|
} else {
|
||||||
failed.push(bucket[i]);
|
failed.push(bucket[i]);
|
||||||
|
@ -485,6 +490,7 @@ impl User {
|
||||||
|
|
||||||
// Attempt to connect to second cred's bridge
|
// Attempt to connect to second cred's bridge
|
||||||
if Self::connect(self.in_censorship_range, &config, bridge, censor) {
|
if Self::connect(self.in_censorship_range, &config, bridge, censor) {
|
||||||
|
self.able_to_connect = true;
|
||||||
succeeded.push(bridgeline);
|
succeeded.push(bridgeline);
|
||||||
if second_reachcred.is_some()
|
if second_reachcred.is_some()
|
||||||
&& eligible_for_trust_promotion(&config.la_net, &second_cred).await
|
&& eligible_for_trust_promotion(&config.la_net, &second_cred).await
|
||||||
|
|
Loading…
Reference in New Issue