add more information to dropped vote warning (#4449)

* add more information to dropped vote warning

* fixup
This commit is contained in:
Rob Walker 2019-05-28 12:25:34 -07:00 committed by GitHub
parent 0e26ee854b
commit ff31ffbd54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -145,10 +145,22 @@ impl VoteState {
.iter() .iter()
.any(|(slot, hash)| vote.slot == *slot && vote.hash == *hash) .any(|(slot, hash)| vote.slot == *slot && vote.hash == *hash)
{ {
warn!( if log_enabled!(log::Level::Warn) {
"dropping vote {:?}, no matching slot/hash combination", for (slot, hash) in slot_hashes {
vote 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; return;
} }