Skip to content

Commit

Permalink
fix lib number
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Voiculescu committed Aug 9, 2024
1 parent 81d0187 commit 2fbe523
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rpc/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,13 @@ func convertBlock(data *FetchedBlockData, specVersion uint32) (*pbbstream.Block,
}

libNum := uint64(0)
if latestFinalizedHead > block.Number && block.Number > 0 {
libNum = block.Number - 1
if latestFinalizedHead > block.Number {
if block.Number > 0 {
libNum = block.Number - 1
}

} else {
libNum = latestFinalizedHead
}

bstreamBlock := &pbbstream.Block{
Expand Down

0 comments on commit 2fbe523

Please sign in to comment.