Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
change indexHeight to indexHeightKey
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro committed Aug 12, 2019
1 parent 19f2193 commit c850108
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions state/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
MaxIndexLag = 100
)

var indexHeight = []byte("indexHeight")
var indexHeightKey = []byte("indexHeightKey")

type IndexService interface {
SetOnIndex(callback func(int64))
Expand Down Expand Up @@ -153,13 +153,13 @@ func (ih *IndexHub) SetIndexedHeight(h int64) {
if err != nil {
ih.Logger.Error("failed to MarshalBinaryBare for indexed height", "error", err, "height", h)
} else {
ih.stateDB.Set(indexHeight, rawHeight)
ih.stateDB.Set(indexHeightKey, rawHeight)
}
}

// if never store `indexHeight` in index db, will return -1.
// if never store `indexHeightKey` in index db, will return -1.
func (ih *IndexHub) GetIndexedHeight() int64 {
rawHeight := ih.stateDB.Get(indexHeight)
rawHeight := ih.stateDB.Get(indexHeightKey)
if rawHeight == nil {
return -1
} else {
Expand Down

0 comments on commit c850108

Please sign in to comment.