Skip to content

Commit

Permalink
Replace error with RecoverWithStake in lib.rs (#426)
Browse files Browse the repository at this point in the history
The SplitWithStake error message for accounts with staked tokens has been replaced with RecoverWithStake. This change is reflected in the lib.rs file under the recover account function. This implementation guards against the possibility of double voting that could occur if an account with staked tokens were allowed to be transferred.
  • Loading branch information
keyvankhademi authored Mar 26, 2024
1 parent fe5f63f commit aad326c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion staking/programs/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ pub mod staking {
// Transferring accounts with staked tokens might lead to double voting
require!(
ctx.accounts.stake_account_metadata.next_index == 0,
ErrorCode::SplitWithStake
ErrorCode::RecoverWithStake
);

let new_owner = ctx.accounts.payer_token_account.owner;
Expand Down

0 comments on commit aad326c

Please sign in to comment.