fix potential underflow
This commit is contained in:
parent
18caefc4a1
commit
c52c2738ab
@ -9,6 +9,7 @@ import (
|
|||||||
blocks "github.com/ipfs/go-block-format"
|
blocks "github.com/ipfs/go-block-format"
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
bstore "github.com/filecoin-project/lotus/blockstore"
|
bstore "github.com/filecoin-project/lotus/blockstore"
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
@ -49,8 +50,11 @@ func (s *SplitStore) warmup(curTs *types.TipSet) error {
|
|||||||
// and headers all the way up to genesis.
|
// and headers all the way up to genesis.
|
||||||
// objects are written in batches so as to minimize overhead.
|
// objects are written in batches so as to minimize overhead.
|
||||||
func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
||||||
|
var boundaryEpoch abi.ChainEpoch
|
||||||
epoch := curTs.Height()
|
epoch := curTs.Height()
|
||||||
boundaryEpoch := epoch - WarmupBoundary
|
if WarmupBoundary < epoch {
|
||||||
|
boundaryEpoch = epoch - WarmupBoundary
|
||||||
|
}
|
||||||
batchHot := make([]blocks.Block, 0, batchSize)
|
batchHot := make([]blocks.Block, 0, batchSize)
|
||||||
count := int64(0)
|
count := int64(0)
|
||||||
xcount := int64(0)
|
xcount := int64(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user