set_lamports() (#16914)

This commit is contained in:
Jeff Washington (jwash)
2021-04-29 10:43:26 -05:00
committed by GitHub
parent 23d67e4ac7
commit 59e19828ea
4 changed files with 15 additions and 10 deletions

View File

@@ -140,7 +140,9 @@ pub fn process_instruction(
if let Some(payment) = expr.final_payment() {
let to_keyed_account = contract_keyed_account;
let contract_keyed_account = keyed_account_at_index(keyed_accounts, 1)?;
contract_keyed_account.try_account_ref_mut()?.lamports = 0;
contract_keyed_account
.try_account_ref_mut()?
.set_lamports(0);
to_keyed_account
.try_account_ref_mut()?
.checked_add_lamports(payment.lamports)?;