@@ -1671,8 +1671,13 @@ fn main() {
1671
1671
path : default_signer_path,
1672
1672
arg_name : default_signer_arg_name,
1673
1673
} ;
1674
- // Owner doesn't sign when it's a multisig; and the `accounts` command is read-only
1675
- let owner = if matches. is_present ( MULTISIG_SIGNER_ARG . name ) || sub_command == "accounts" {
1674
+
1675
+ // Owner doesn't sign when using a mulitisig...
1676
+ let owner = if matches. is_present ( MULTISIG_SIGNER_ARG . name )
1677
+ || sub_command == "accounts" // when calling the `accounts` command...
1678
+ || ( sub_command == "create-account" // or when creating an associated token account.
1679
+ && !matches. is_present ( "account_keypair" ) )
1680
+ {
1676
1681
let owner_val = matches
1677
1682
. value_of ( "owner" )
1678
1683
. unwrap_or ( & cli_config. keypair_path ) ;
@@ -1794,17 +1799,20 @@ fn main() {
1794
1799
. unwrap ( )
1795
1800
. unwrap ( ) ;
1796
1801
1797
- let ( signer, account) = if arg_matches. is_present ( "account_keypair" ) {
1798
- signer_of ( & arg_matches, "account_keypair" , & mut wallet_manager) . unwrap_or_else (
1799
- |e| {
1800
- eprintln ! ( "error: {}" , e) ;
1801
- exit ( 1 ) ;
1802
- } ,
1803
- )
1802
+ let account = if arg_matches. is_present ( "account_keypair" ) {
1803
+ let ( signer, account) =
1804
+ signer_of ( & arg_matches, "account_keypair" , & mut wallet_manager) . unwrap_or_else (
1805
+ |e| {
1806
+ eprintln ! ( "error: {}" , e) ;
1807
+ exit ( 1 ) ;
1808
+ } ,
1809
+ ) ;
1810
+ bulk_signers. push ( signer) ;
1811
+ account
1804
1812
} else {
1805
- ( None , None )
1813
+ // No need to add a signer when creating an associated token account
1814
+ None
1806
1815
} ;
1807
- bulk_signers. push ( signer) ;
1808
1816
1809
1817
command_create_account ( & config, token, account)
1810
1818
}
0 commit comments