fix unittests

This commit is contained in:
Tuna 2018-05-31 17:09:52 +07:00
parent 0ae49c74fa
commit 90ceb82c9c
2 changed files with 2 additions and 3 deletions

View file

@ -1186,7 +1186,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
stats.usedGas += usedGas
stats.report(chain, i, bc.stateCache.TrieDB().Size())
if i == len(chain)-1 {
if (chain[i].NumberU64() % bc.chainConfig.Clique.Epoch) == 0 {
if (bc.chainConfig.Clique != nil) && (chain[i].NumberU64()%bc.chainConfig.Clique.Epoch) == 0 {
Checkpoint <- 1
}
}

View file

@ -488,8 +488,7 @@ func (self *worker) commitNewWork() {
log.Info("Commit new mining work", "number", work.Block.Number(), "txs", work.tcount, "uncles", len(uncles), "elapsed", common.PrettyDuration(time.Since(tstart)))
self.unconfirmed.Shift(work.Block.NumberU64() - 1)
}
if (work.Block.NumberU64() % work.config.Clique.Epoch) == 0 {
log.Info("hey checkpoint")
if (work.config.Clique != nil) && (work.Block.NumberU64()%work.config.Clique.Epoch) == 0 {
core.Checkpoint <- 1
}
self.push(work)