Skip to content

Commit

Permalink
check error in TruncateBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Feb 12, 2023
1 parent ab8e59f commit 319af1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,9 @@ func TruncateBlocks(ctx context.Context, tx kv.RwTx, blockFrom uint64) error {
}
}
for ; k != nil; k, _, err = c.Prev() {
if err != nil {
return err
}
n := binary.BigEndian.Uint64(k)
if n < blockFrom { // [from, to)
break
Expand Down

0 comments on commit 319af1e

Please sign in to comment.