Don't reuse executable accounts between instructions (#10403) (#10405)

automerge
This commit is contained in:
mergify[bot]
2020-06-03 23:36:14 -07:00
committed by GitHub
parent 6a72dab111
commit d5b03bd824
2 changed files with 39 additions and 6 deletions

View File

@@ -516,15 +516,10 @@ impl MessageProcessor {
rent_collector: &RentCollector,
) -> Result<(), TransactionError> {
for (instruction_index, instruction) in message.instructions.iter().enumerate() {
let executable_index = message
.program_position(instruction.program_id_index as usize)
.ok_or(TransactionError::InvalidAccountIndex)?;
let executable_accounts = &loaders[executable_index];
self.execute_instruction(
message,
instruction,
executable_accounts,
&loaders[instruction_index],
accounts,
rent_collector,
)