Skip to content

Commit

Permalink
Add metrics to vote account close feature (#25746) (#25762)
Browse files Browse the repository at this point in the history
(cherry picked from commit 88299e7)

Co-authored-by: Will Hickey <will.hickey@solana.com>
  • Loading branch information
mergify[bot] and willhickey authored Jun 3, 2022
1 parent 21701c9 commit 9a88655
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions programs/vote/src/vote_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use {
bincode::{deserialize, serialize_into, serialized_size, ErrorKind},
log::*,
serde_derive::{Deserialize, Serialize},
solana_metrics::datapoint_debug,
solana_sdk::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
account_utils::State,
Expand Down Expand Up @@ -933,9 +934,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 {
Expand Down

0 comments on commit 9a88655

Please sign in to comment.