Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Nov 7, 2024
1 parent 906ccfc commit 0c4e0ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions erigon-lib/kv/order/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ func Must(asc By, k1, k2 []byte) {
return
}
if asc {
if bytes.Compare(k1, k2) <= 0 {
if bytes.Compare(k1, k2) > 0 {
panic(fmt.Sprintf("epect: %x <= %x", k1, k2))
}
} else {
if bytes.Compare(k1, k2) >= 0 {
panic(fmt.Sprintf("epect: %x >= %x", k1, k2))
}
return
}
if bytes.Compare(k1, k2) < 0 {
panic(fmt.Sprintf("epect: %x >= %x", k1, k2))
}
}
3 changes: 2 additions & 1 deletion erigon-lib/state/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ func (hi *StateAsOfIterF) Next() ([]byte, []byte, error) {
if err := hi.advanceInFiles(); err != nil {
return nil, nil, err
}
fmt.Printf("[dbg] StateAsOfIterF.next: limit=%d, %x\n", hi.limit, hi.kBackup)
order.Must(hi.orderAscend, hi.kBackup, hi.nextKey)
return hi.kBackup, hi.vBackup, nil
}

Expand Down Expand Up @@ -1679,6 +1679,7 @@ func (hi *StateAsOfIterDB) Next() ([]byte, []byte, error) {
if err := hi.advance(); err != nil {
return nil, nil, err
}
order.Must(hi.orderAscend, hi.kBackup, hi.nextKey)
return hi.kBackup, hi.vBackup, nil
}

Expand Down

0 comments on commit 0c4e0ad

Please sign in to comment.