Skip to content

Commit

Permalink
invalidate order correction (#3064)
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother authored Sep 23, 2024
1 parent 29b79c3 commit ae8be4e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/ain-ocean/src/indexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,6 @@ pub fn invalidate_block(services: &Arc<Services>, block: Block<Transaction>) ->
median_time: block.mediantime,
};

// invalidate_block
services.block.by_height.delete(&block.height)?;
services.block.by_id.delete(&block.hash)?;

invalidate_block_end(services, &block_ctx)?;

// invalidate_dftx
Expand All @@ -725,6 +721,10 @@ pub fn invalidate_block(services: &Arc<Services>, block: Block<Transaction>) ->
tx_idx,
};

invalidate_script(services, &ctx, &block.tx)?;

invalidate_transaction(services, &ctx)?;

let bytes = &ctx.tx.vout[0].script_pub_key.hex;
if bytes.len() <= 6 || bytes[0] != 0x6a || bytes[1] > 0x4e {
continue;
Expand Down Expand Up @@ -760,12 +760,13 @@ pub fn invalidate_block(services: &Arc<Services>, block: Block<Transaction>) ->
log_elapsed(start, "Invalidate dftx");
}
}

invalidate_transaction(services, &ctx)?;

invalidate_script(services, &ctx, &block.tx)?;
}

invalidate_block_start(services, &block)?;

// invalidate_block
services.block.by_height.delete(&block.height)?;
services.block.by_id.delete(&block.hash)?;

Ok(())
}

0 comments on commit ae8be4e

Please sign in to comment.