Refactor vote state to remove double negative (#21244)
This commit is contained in:
@ -204,7 +204,8 @@ impl Stakes {
|
||||
let old = self.vote_accounts.remove(pubkey);
|
||||
// when account is removed (lamports == 0 or data uninitialized), don't read so that
|
||||
// given `pubkey` can be used for any owner in the future, while not affecting Stakes.
|
||||
if account.lamports() != 0 && !VoteState::is_uninitialized_no_deser(account.data()) {
|
||||
if account.lamports() != 0 && VoteState::is_correct_size_and_initialized(account.data())
|
||||
{
|
||||
let stake = old.as_ref().map_or_else(
|
||||
|| self.calculate_stake(pubkey, self.epoch, Some(&self.stake_history)),
|
||||
|v| v.0,
|
||||
|
Reference in New Issue
Block a user