Skip to main content

realloc_checked

Function realloc_checked 

Source
pub fn realloc_checked(
    account: &AccountView,
    new_len: usize,
    payer: Option<&AccountView>,
) -> ProgramResult
Expand description

Checked realloc that also ensures the account remains rent-exempt after resizing.

This is the safe version of account.resize() – it verifies that the account has enough lamports to cover rent at the new data length.