Skip to content

Commit

Permalink
fix: dc at blocknum
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-98 committed Feb 17, 2024
1 parent d28a2d4 commit 00c743e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ds/dc_wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ func (dcw *DataCompressorWrapper) LoadMultipleDC(multiDCs interface{}) {

func (dcw *DataCompressorWrapper) GetKeyAndAddress(version core.VersionType, blockNum int64) (string, common.Address) {
if version.MoreThanEq(core.NewVersion(300)) {
for _, entry := range dcw.versionToAddress[version] {
if entry.block <= blockNum {
return DCV3, entry.address
arr := dcw.versionToAddress[version]
for i := len(arr) - 1; i >= 0; i-- {
if arr[i].block <= blockNum {
return DCV3, arr[i].address
}
}
return NODC, core.NULL_ADDR
Expand Down

0 comments on commit 00c743e

Please sign in to comment.