This commit is contained in:
Hardhat Chad
2025-07-14 14:55:27 -07:00
parent 2719189b5d
commit 31c4da1d6d
3 changed files with 11 additions and 1 deletions

View File

@@ -61,6 +61,8 @@ pub fn process_uncommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
block.total_committed -= amount;
// Close permit account, if empty.
let fee = permit.fee;
let commitment = permit.commitment;
if permit.commitment == 0 {
permit_info.close(signer_info)?;
}
@@ -74,8 +76,9 @@ pub fn process_uncommit(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
authority: *signer_info.key,
block_id: block.id,
block_commitment: block.total_committed,
permit_commitment: permit.commitment,
permit_commitment: commitment,
amount,
fee,
ts: clock.unix_timestamp,
}
.to_bytes(),