account.lamports -= (#16913)

This commit is contained in:
Jeff Washington (jwash) 2021-04-28 15:47:59 -05:00 committed by GitHub
parent 21c75d9d29
commit 8dc15f727c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -685,7 +685,9 @@ pub fn withdraw<S: std::hash::BuildHasher>(
}
_ => (),
}
vote_account.try_account_ref_mut()?.lamports -= lamports;
vote_account
.try_account_ref_mut()?
.checked_sub_lamports(lamports)?;
to_account
.try_account_ref_mut()?
.checked_add_lamports(lamports)?;