We need to subtract both the current built circuits *and* the attempted
circuits from the attempt count during scaling, since *both* have already been
counted there.
/* Verify that the counts are sane before and after scaling */
int counts_are_sane = (guard->circ_attempts >= guard->circ_successes);
- guard->circ_attempts -= opened_attempts;
+ guard->circ_attempts -= (opened_attempts+opened_built);
guard->circ_successes -= opened_built;
guard->circ_attempts *= scale_ratio;
guard->collapsed_circuits *= scale_ratio;
guard->unusable_circuits *= scale_ratio;
- guard->circ_attempts += opened_attempts;
+ guard->circ_attempts += (opened_attempts+opened_built);
guard->circ_successes += opened_built;
entry_guards_changed();