Skip to content

Commit

Permalink
change lru to lru.cache to make sure thread safe (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored Jun 2, 2021
1 parent 6766f83 commit 822e664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/evm/watcher/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"strconv"

"github.com/hashicorp/golang-lru/simplelru"
lru "github.com/hashicorp/golang-lru"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -22,7 +22,7 @@ const MsgFunctionDisable = "fast query function has been disabled"
type Querier struct {
store *WatchStore
sw bool
lru *simplelru.LRU
lru *lru.Cache
}

func (q Querier) enabled() bool {
Expand All @@ -34,7 +34,7 @@ func (q *Querier) Enable(sw bool) {
}

func NewQuerier() *Querier {
lru, e := simplelru.NewLRU(GetWatchLruSize(), nil)
lru, e := lru.New(GetWatchLruSize())
if e != nil {
panic(errors.New("Failed to init LRU Cause " + e.Error()))
}
Expand Down

0 comments on commit 822e664

Please sign in to comment.