Reject close of active vote accounts (#22651)
* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
This commit is contained in:
@@ -113,6 +113,7 @@ enum InstructionErrorType {
|
||||
UNSUPPORTED_SYSVAR = 48;
|
||||
ILLEGAL_OWNER = 49;
|
||||
ACCOUNTS_DATA_BUDGET_EXCEEDED = 50;
|
||||
ACTIVE_VOTE_ACCOUNT_CLOSE = 51;
|
||||
}
|
||||
|
||||
message UnixTimestamp {
|
||||
|
@@ -689,6 +689,7 @@ impl TryFrom<tx_by_addr::TransactionError> for TransactionError {
|
||||
48 => InstructionError::UnsupportedSysvar,
|
||||
49 => InstructionError::IllegalOwner,
|
||||
50 => InstructionError::AccountsDataBudgetExceeded,
|
||||
51 => InstructionError::ActiveVoteAccountClose,
|
||||
_ => return Err("Invalid InstructionError"),
|
||||
};
|
||||
|
||||
@@ -979,6 +980,9 @@ impl From<TransactionError> for tx_by_addr::TransactionError {
|
||||
InstructionError::AccountsDataBudgetExceeded => {
|
||||
tx_by_addr::InstructionErrorType::AccountsDataBudgetExceeded
|
||||
}
|
||||
InstructionError::ActiveVoteAccountClose => {
|
||||
tx_by_addr::InstructionErrorType::ActiveVoteAccountClose
|
||||
}
|
||||
} as i32,
|
||||
custom: match instruction_error {
|
||||
InstructionError::Custom(custom) => {
|
||||
|
Reference in New Issue
Block a user