Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
ignore irrelevant approvals in logs (#3859)
Browse files Browse the repository at this point in the history
* ignore irrelevant approvals in logs

* fix
  • Loading branch information
rphmeier authored Oct 3, 2021
1 parent 8e7486b commit 2bc4b5e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,10 +1288,21 @@ async fn handle_approved_ancestor(
);
},
Some(a_entry) => {
let n_assignments = a_entry.n_assignments();
let n_approvals = c_entry.approvals().count_ones();

let status = || {
let n_assignments = a_entry.n_assignments();

// Take the approvals, filtered by the assignments
// for this block.
let n_approvals = c_entry
.approvals()
.iter()
.by_val()
.enumerate()
.filter(|(i, approved)| {
*approved && a_entry.is_assigned(ValidatorIndex(*i as _))
})
.count();

format!(
"{}/{}/{}",
n_assignments,
Expand Down

0 comments on commit 2bc4b5e

Please sign in to comment.