File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
token/program-2022/src/extension/confidential_transfer Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ impl ConfidentialTransferAccount {
108
108
pub fn closable ( & self ) -> ProgramResult {
109
109
if self . pending_balance == pod:: ElGamalCiphertext :: zeroed ( )
110
110
&& self . available_balance == pod:: ElGamalCiphertext :: zeroed ( )
111
+ && self . withheld_amount == pod:: ElGamalCiphertext :: zeroed ( )
111
112
{
112
113
Ok ( ( ) )
113
114
} else {
Original file line number Diff line number Diff line change @@ -236,6 +236,11 @@ fn process_empty_account(
236
236
}
237
237
238
238
ct_token_account. available_balance = pod:: ElGamalCiphertext :: zeroed ( ) ;
239
+
240
+ if ct_token_account. withheld_amount != pod:: ElGamalCiphertext :: zeroed ( ) {
241
+ msg ! ( "Withheld amount is not zero" ) ;
242
+ return Err ( ProgramError :: InvalidAccountData ) ;
243
+ }
239
244
ct_token_account. closable ( ) ?;
240
245
241
246
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments