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

automerge
This commit is contained in:
Jack May
2020-06-03 21:16:15 -07:00
committed by GitHub
parent 21d62493ff
commit 61d91d2d55
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,
)