fix(provider): fix subtract overflow on block_state_by_tx_id (#10467)

This commit is contained in:
joshieDo
2024-08-23 16:27:24 +01:00
committed by GitHub
parent 961821cf38
commit 23f9f4adf2

View File

@ -165,7 +165,7 @@ where
let Some(body_index) = provider.block_body_indices(block_number)? else {
return Ok(None)
};
let tx_index = id - body_index.last_tx_num();
let tx_index = body_index.last_tx_num() - id;
Ok(Some((None, tx_index as usize)))
} else {
// Otherwise, iterate through in-memory blocks and find the transaction with the