mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
update comments
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::utils::AccountDeserialize;
|
||||
|
||||
/// Close closes a proof account and returns the rent to the owner.
|
||||
pub fn process_close<'a, 'info>(accounts: &'a [AccountInfo<'info>], _data: &[u8]) -> ProgramResult {
|
||||
// Load accounts
|
||||
// Load accounts.
|
||||
let [signer, proof_info, system_program] = accounts else {
|
||||
return Err(ProgramError::NotEnoughAccountKeys);
|
||||
};
|
||||
@@ -16,7 +16,7 @@ pub fn process_close<'a, 'info>(accounts: &'a [AccountInfo<'info>], _data: &[u8]
|
||||
load_proof(proof_info, signer.key, true)?;
|
||||
load_program(system_program, system_program::id())?;
|
||||
|
||||
// Validate balance is zero
|
||||
// Validate balance is zero.
|
||||
let proof_data = proof_info.data.borrow();
|
||||
let proof = Proof::try_from_bytes(&proof_data)?;
|
||||
if proof.balance.gt(&0) {
|
||||
@@ -24,10 +24,10 @@ pub fn process_close<'a, 'info>(accounts: &'a [AccountInfo<'info>], _data: &[u8]
|
||||
}
|
||||
drop(proof_data);
|
||||
|
||||
// Realloc data to zero
|
||||
// Realloc data to zero.
|
||||
proof_info.realloc(0, true)?;
|
||||
|
||||
// Send lamports to signer
|
||||
// Send remaining lamports to signer.
|
||||
**signer.lamports.borrow_mut() += proof_info.lamports();
|
||||
**proof_info.lamports.borrow_mut() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user