mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(provider): fix sub overflow on tx_range queries for empty blocks (#11568)
This commit is contained in:
@ -463,8 +463,9 @@ impl<N: ProviderNodeTypes> BlockchainProvider2<N> {
|
|||||||
let block_tx_count = block_state.block_ref().block().body.transactions.len();
|
let block_tx_count = block_state.block_ref().block().body.transactions.len();
|
||||||
let remaining = (tx_range.end() - tx_range.start() + 1) as usize;
|
let remaining = (tx_range.end() - tx_range.start() + 1) as usize;
|
||||||
|
|
||||||
// If the transaction range start is higher than this block last transaction, advance
|
// If the transaction range start is equal or higher than the next block first
|
||||||
if *tx_range.start() > in_memory_tx_num + block_tx_count as u64 - 1 {
|
// transaction, advance
|
||||||
|
if *tx_range.start() >= in_memory_tx_num + block_tx_count as u64 {
|
||||||
in_memory_tx_num += block_tx_count as u64;
|
in_memory_tx_num += block_tx_count as u64;
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user