Skip to content

Commit

Permalink
Use the same check as commit_finalized() for finalized block heights
Browse files Browse the repository at this point in the history
Co-authored-by: Marek <[email protected]>
  • Loading branch information
teor2345 and upbqdn authored Sep 27, 2022
1 parent 96d3966 commit b150e3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zebra-state/src/service/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ pub fn write_blocks_from_channels(
.map(|height| (height + 1).expect("committed heights are valid"))
.unwrap_or(Height(0));

if ordered_block.0.height > next_valid_height {
if ordered_block.0.height != next_valid_height {
debug!(
?next_valid_height,
invalid_height = ?ordered_block.0.height,
invalid_hash = ?ordered_block.0.hash,
"got a block that was too high. \
"got a block that was the wrong height. \
Assuming a parent block failed, and dropping this block",
);

Expand Down

0 comments on commit b150e3f

Please sign in to comment.