make it a const

This commit is contained in:
whyrusleeping 2019-10-09 21:55:27 +09:00
parent bb974d23e6
commit 67058aee53
2 changed files with 5 additions and 1 deletions

View File

@ -85,3 +85,6 @@ func init() {
panic("could not parse InitialRewardStr")
}
}
// Sync
const BadBlockCacheSize = 8192

View File

@ -1,6 +1,7 @@
package chain
import (
"github.com/filecoin-project/go-lotus/build"
lru "github.com/hashicorp/golang-lru"
"github.com/ipfs/go-cid"
)
@ -10,7 +11,7 @@ type BadBlockCache struct {
}
func NewBadBlockCache() *BadBlockCache {
cache, err := lru.NewARC(8192)
cache, err := lru.NewARC(build.BadBlockCacheSize)
if err != nil {
panic(err)
}