Fix duplicate records of inner instructions (#13380)

* Fix duplicate records of inner instructions

* fix tests

* fix clippy

* Remove bad_inner_instructions
This commit is contained in:
Justin Starry
2020-11-05 15:23:52 +08:00
committed by GitHub
parent 66c3c6c2b3
commit c24fbb6f8b
3 changed files with 23 additions and 8 deletions

View File

@ -2437,10 +2437,10 @@ impl Bank {
Self::accounts_to_refcells(accounts, loaders);
let instruction_recorders = if enable_cpi_recording {
Some(vec![
InstructionRecorder::default();
tx.message.instructions.len()
])
let ix_count = tx.message.instructions.len();
let mut recorders = Vec::with_capacity(ix_count);
recorders.resize_with(ix_count, InstructionRecorder::default);
Some(recorders)
} else {
None
};