Skip to content

Commit

Permalink
add more information to dropped vote warning (solana-labs#4449)
Browse files Browse the repository at this point in the history
* add more information to dropped vote warning

* fixup
  • Loading branch information
rob-solana committed May 28, 2019
1 parent 8815762 commit 89008ef
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions programs/vote_api/src/vote_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,22 @@ impl VoteState {
.iter()
.any(|(slot, hash)| vote.slot == *slot && vote.hash == *hash)
{
warn!(
"dropping vote {:?}, no matching slot/hash combination",
vote
);
if log_enabled!(log::Level::Warn) {
for (slot, hash) in slot_hashes {
if vote.slot == *slot {
warn!(
"dropped vote {:?} matched slot {}, but not hash {:?}",
vote, *slot, *hash
);
}
if vote.hash == *hash {
warn!(
"dropped vote {:?} matched hash {:?}, but not slot {}",
vote, *hash, *slot,
);
}
}
}
return;
}

Expand Down

0 comments on commit 89008ef

Please sign in to comment.