Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
Report potential bad solutions #21 #22
Browse files Browse the repository at this point in the history
  • Loading branch information
kianenigma committed Jul 21, 2020
1 parent 6c68b00 commit c60d6a7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions offline-election/src/subcommands/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,20 @@ pub async fn run(client: &Client, opt: Opt, conf: StakingConfig) {
let improved_score = evaluate_support(&supports);
log::info!(
target: LOG_TARGET,
"Equalized the results for [{}/{}] iterations, improved slot stake by {:?}",
"Balanced the results for [{}/{}] iterations, improved slot stake by {:?}",
done,
iterations,
Currency(improved_score[0] - initial_score[0]),
Currency(
improved_score[0]
.checked_sub(initial_score[0])
.unwrap_or_else(|| {
log::error!(
target: LOG_TARGET,
"Balancing has returned a set which has a lower slot stake. This is most likely a serious bug.",
);
0
})
),
);
initial_score = improved_score;
}
Expand Down

0 comments on commit c60d6a7

Please sign in to comment.