diff --git a/wallet/src/cli/programs/native_token_transfer.rs b/wallet/src/cli/programs/native_token_transfer.rs index b3f833ac..93a4a583 100644 --- a/wallet/src/cli/programs/native_token_transfer.rs +++ b/wallet/src/cli/programs/native_token_transfer.rs @@ -121,6 +121,13 @@ impl WalletSubcommand for AuthTransferSubcommand { let (from, from_privacy) = parse_addr_with_privacy_prefix(&from)?; let (to, to_privacy) = parse_addr_with_privacy_prefix(&to)?; + if from == to { + anyhow::bail!( + "Invalid transfer: --from and --to cannot be the same account ({})", + from + ); + } + match (from_privacy, to_privacy) { (AccountPrivacyKind::Public, AccountPrivacyKind::Public) => { NativeTokenTransferProgramSubcommand::Public { from, to, amount }