This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -576,8 +576,8 @@ fn command_transfer(
576
576
recipient_token_account
577
577
) ;
578
578
579
- if !config. sign_only {
580
- let needs_funding = if let Some ( recipient_token_account_data) = config
579
+ let needs_funding = if !config. sign_only {
580
+ if let Some ( recipient_token_account_data) = config
581
581
. rpc_client
582
582
. get_account_with_commitment (
583
583
& recipient_token_account,
@@ -596,10 +596,14 @@ fn command_transfer(
596
596
}
597
597
} else {
598
598
true
599
- } ;
599
+ }
600
+ } else {
601
+ fund_recipient
602
+ } ;
600
603
601
- if needs_funding {
602
- if fund_recipient {
604
+ if needs_funding {
605
+ if fund_recipient {
606
+ if !config. sign_only {
603
607
minimum_balance_for_rent_exemption += config
604
608
. rpc_client
605
609
. get_minimum_balance_for_rent_exemption ( Account :: LEN ) ?;
@@ -608,18 +612,18 @@ fn command_transfer(
608
612
recipient_token_account,
609
613
lamports_to_sol( minimum_balance_for_rent_exemption)
610
614
) ;
611
- instructions. push ( create_associated_token_account (
612
- & config. fee_payer ,
613
- & recipient,
614
- & mint_pubkey,
615
- ) ) ;
616
- } else {
617
- return Err (
618
- "Error: Recipient's associated token account does not exist. \
619
- Add `--fund-recipient` to fund their account"
620
- . into ( ) ,
621
- ) ;
622
615
}
616
+ instructions. push ( create_associated_token_account (
617
+ & config. fee_payer ,
618
+ & recipient,
619
+ & mint_pubkey,
620
+ ) ) ;
621
+ } else {
622
+ return Err (
623
+ "Error: Recipient's associated token account does not exist. \
624
+ Add `--fund-recipient` to fund their account"
625
+ . into ( ) ,
626
+ ) ;
623
627
}
624
628
}
625
629
}
You can’t perform that action at this time.
0 commit comments