From ff31ffbd54114ab7fa62181b0a756b8d67adaa9a Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Tue, 28 May 2019 12:25:34 -0700 Subject: [PATCH] add more information to dropped vote warning (#4449) * add more information to dropped vote warning * fixup --- programs/vote_api/src/vote_state.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/programs/vote_api/src/vote_state.rs b/programs/vote_api/src/vote_state.rs index 549eccef90..64855afb24 100644 --- a/programs/vote_api/src/vote_state.rs +++ b/programs/vote_api/src/vote_state.rs @@ -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; }