Skip to content

Commit

Permalink
fix: panic (#209)
Browse files Browse the repository at this point in the history
Description
---
fixx panic
  • Loading branch information
SWvheerden authored Dec 5, 2024
1 parent 0b7135e commit 54f0d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sharechain/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ impl ShareChain for InMemoryShareChain {
};
if let Some(level) = p2_chain_read_lock.level_at_height(height) {
if let Some(block) = level.block_in_main_chain() {
let index = i_have_blocks.len() - counter;
let index = i_have_blocks.len().saturating_sub(counter).saturating_sub(1);
i_have_blocks[index] = (height, block.hash);
counter += 1;
}
Expand Down

0 comments on commit 54f0d33

Please sign in to comment.