Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(provider): fix sub overflow on tx_range queries for empty blocks #11568

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ impl<N: ProviderNodeTypes> BlockchainProvider2<N> {
let block_tx_count = block_state.block_ref().block().body.transactions.len();
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 *tx_range.start() > in_memory_tx_num + block_tx_count as u64 - 1 {
// If the transaction range start is equal or higher than the next block first
// transaction, advance
if *tx_range.start() >= in_memory_tx_num + block_tx_count as u64 {
in_memory_tx_num += block_tx_count as u64;
continue
}
Expand Down
Loading