Add metrics to vote account close feature (#25746)

This commit is contained in:
Will Hickey 2022-06-03 11:27:46 -05:00 committed by GitHub
parent 779ec564e4
commit 88299e72b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ use {
bincode::{deserialize, serialize_into, ErrorKind},
log::*,
serde_derive::{Deserialize, Serialize},
solana_metrics::datapoint_debug,
solana_sdk::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
clock::{Epoch, Slot, UnixTimestamp},
@ -1297,9 +1298,11 @@ pub fn withdraw<S: std::hash::BuildHasher>(
.unwrap_or(false);
if reject_active_vote_account_close {
datapoint_debug!("vote-account-close", ("reject-active", 1, i64));
return Err(InstructionError::ActiveVoteAccountClose);
} else {
// Deinitialize upon zero-balance
datapoint_debug!("vote-account-close", ("allow", 1, i64));
vote_account.set_state(&VoteStateVersions::new_current(VoteState::default()))?;
}
} else if let Some(rent_sysvar) = rent_sysvar {