From efa8aa19e73f98cdd085cf00fff951bcbf5da3d6 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Wed, 20 Feb 2019 12:52:03 +1100 Subject: [PATCH] Corrects small comments. --- eth2/fork_choice/src/bitwise_lmd_ghost.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/eth2/fork_choice/src/bitwise_lmd_ghost.rs b/eth2/fork_choice/src/bitwise_lmd_ghost.rs index c467545ea5..e1d246e923 100644 --- a/eth2/fork_choice/src/bitwise_lmd_ghost.rs +++ b/eth2/fork_choice/src/bitwise_lmd_ghost.rs @@ -201,13 +201,14 @@ where None } - // Finds the best child, splitting children into a binary tree, based on their hashes + // Finds the best child, splitting children into a binary tree, based on their hashes (Bitwise + // LMD Ghost) fn choose_best_child(&self, votes: &HashMap) -> Option { if votes.is_empty() { return None; } let mut bitmask: BitVec = BitVec::new(); - // loop through bytes then bits + // loop through all bits for bit in 0..=256 { let mut zero_votes = 0; let mut one_votes = 0; @@ -216,16 +217,8 @@ where trace!("Child vote length: {}", votes.len()); for (candidate, votes) in votes.iter() { let candidate_bit: BitVec = BitVec::from_bytes(&candidate); - /* - trace!( - "Child: {} in bits: {:?}", - candidate, - candidate_bit - ); - trace!("Current bitmask: {:?}", bitmask); - */ - // if the bitmasks don't match + // if the bitmasks don't match, exclude candidate if !bitmask.iter().eq(candidate_bit.iter().take(bit)) { trace!( "Child: {} was removed in bit: {} with the bitmask: {:?}",