Fix potential storage bug

The previous code was assuming the instruction index and the
program_id index were the same. That's always true for
single-instruction transactions, but not for multiples.
This commit is contained in:
Greg Fitzgerald 2019-04-02 16:11:39 -06:00
parent 4c0bc1fd88
commit 978ff87b76
1 changed files with 4 additions and 3 deletions

View File

@ -402,9 +402,10 @@ impl StorageStage {
// the storage_keys with their signatures
for tx in entry.transactions {
let message = tx.message();
for (i, program_id) in message.program_ids().iter().enumerate() {
if solana_storage_api::check_id(&program_id) {
match deserialize(&message.instructions[i].data) {
for instruction in &message.instructions {
let program_id = instruction.program_id(message.program_ids());
if solana_storage_api::check_id(program_id) {
match deserialize(&instruction.data) {
Ok(StorageInstruction::SubmitMiningProof {
entry_height: proof_entry_height,
signature,