account data.fill replacement (#16037)

This commit is contained in:
Jeff Washington (jwash) 2021-03-19 15:13:20 -05:00 committed by GitHub
parent 038f80d7fd
commit 64429104b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -667,7 +667,9 @@ fn process_loader_upgradeable_instruction(
recipient_account.try_account_ref_mut()?.lamports += close_account.lamports()?;
close_account.try_account_ref_mut()?.lamports = 0;
close_account.try_account_ref_mut()?.data.fill(0);
for elt in close_account.try_account_ref_mut()?.data_as_mut_slice() {
*elt = 0;
}
} else {
ic_logger_msg!(logger, "Account does not support closing");
return Err(InstructionError::InvalidArgument);