automerge
This commit is contained in:
@@ -527,12 +527,16 @@ pub fn process_create_stake_account(
|
||||
(&stake_account_pubkey, "stake_account_pubkey".to_string()),
|
||||
)?;
|
||||
|
||||
if rpc_client.get_account(&stake_account_pubkey).is_ok() {
|
||||
return Err(CliError::BadParameter(format!(
|
||||
"Unable to create stake account. Stake account already exists: {}",
|
||||
stake_account_pubkey
|
||||
))
|
||||
.into());
|
||||
if let Ok(stake_account) = rpc_client.get_account(&stake_account_pubkey) {
|
||||
let err_msg = if stake_account.owner == solana_stake_program::id() {
|
||||
format!("Stake account {} already exists", stake_account_pubkey)
|
||||
} else {
|
||||
format!(
|
||||
"Account {} already exists and is not a stake account",
|
||||
stake_account_pubkey
|
||||
)
|
||||
};
|
||||
return Err(CliError::BadParameter(err_msg).into());
|
||||
}
|
||||
|
||||
let minimum_balance =
|
||||
|
Reference in New Issue
Block a user