Skip to main content

check_closed

Function check_closed 

Source
pub fn check_closed(account: &AccountView) -> ProgramResult
Expand description

Verify an account is fully closed: zero lamports and empty data.

Useful in CPI-heavy programs where you need to confirm a previous instruction already closed an account before you reuse its address or proceed to a next step that assumes it’s gone.