From 9a886554095042db23797d3ef319fa63d0c25cfd Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Jun 2022 18:12:25 +0000 Subject: [PATCH] Add metrics to vote account close feature (#25746) (#25762) (cherry picked from commit 88299e72b8ecca642ee217f9a9bd2a653a9600bb) Co-authored-by: Will Hickey --- programs/vote/src/vote_state/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programs/vote/src/vote_state/mod.rs b/programs/vote/src/vote_state/mod.rs index c83643a70173dd..7a70cfa2e2324a 100644 --- a/programs/vote/src/vote_state/mod.rs +++ b/programs/vote/src/vote_state/mod.rs @@ -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, @@ -933,9 +934,11 @@ pub fn withdraw( .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 {