Soften vote account identity mismatch from panic to runtime error

This commit is contained in:
Michael Vines
2022-01-13 17:14:04 -08:00
parent 304afd42c6
commit debac00724
2 changed files with 8 additions and 4 deletions

View File

@ -1157,10 +1157,6 @@ impl Tower {
self.node_pubkey,
bank.slot(),
);
assert_eq!(
self.vote_state.node_pubkey, self.node_pubkey,
"vote account's node_pubkey doesn't match",
);
} else {
self.initialize_root(root);
info!(

View File

@ -1454,6 +1454,14 @@ impl ReplayStage {
}
Ok(vote_state) => vote_state,
};
if vote_state.node_pubkey != node_keypair.pubkey() {
info!(
"Vote account node_pubkey mismatch: {} (expected: {}). Unable to vote",
vote_state.node_pubkey,
node_keypair.pubkey()
);
return None;
}
let authorized_voter_pubkey =
if let Some(authorized_voter_pubkey) = vote_state.get_authorized_voter(bank.epoch()) {
authorized_voter_pubkey