checked_sub_lamports (#16923)

This commit is contained in:
Jeff Washington (jwash)
2021-04-29 12:38:21 -05:00
committed by GitHub
parent ca7b36ad8f
commit c9c94a7ef2
2 changed files with 6 additions and 4 deletions

View File

@ -189,7 +189,7 @@ fn transfer_verified(
return Err(SystemError::ResultWithNegativeLamports.into());
}
from.try_account_ref_mut()?.lamports -= lamports;
from.try_account_ref_mut()?.checked_sub_lamports(lamports)?;
to.try_account_ref_mut()?.checked_add_lamports(lamports)?;
Ok(())
}