solana-validator set-identity no longer writes a tower file unnecessarily

This commit is contained in:
Michael Vines
2022-03-06 17:56:12 +01:00
parent 8438366d1b
commit b719d6a2ad
2 changed files with 13 additions and 34 deletions

View File

@ -735,11 +735,16 @@ impl ReplayStage {
restored_tower.adjust_lockouts_after_replay(root_bank.slot(), &slot_history)
}).
unwrap_or_else(|err| {
// It's a fatal error if the tower is not present. This is
// necessary to prevent the validator from violating
// lockouts for its new identity
error!("Failed to load tower for {}: {}", my_pubkey, err);
std::process::exit(1);
if err.is_file_missing() {
Tower::new_from_bankforks(
&bank_forks.read().unwrap(),
&my_pubkey,
&vote_account,
)
} else {
error!("Failed to load tower for {}: {}", my_pubkey, err);
std::process::exit(1);
}
});
// Ensure the validator can land votes with the new identity before