mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
FIX UNITTESTS
This commit is contained in:
parent
f7fac4ec91
commit
5f79d00d04
2 changed files with 12 additions and 6 deletions
|
|
@ -47,8 +47,8 @@ import (
|
|||
|
||||
var (
|
||||
blockInsertTimer = metrics.NewRegisteredTimer("chain/inserts", nil)
|
||||
|
||||
ErrNoGenesis = errors.New("Genesis not found in chain")
|
||||
Checkpoint = make(chan int)
|
||||
ErrNoGenesis = errors.New("Genesis not found in chain")
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -1185,6 +1185,11 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
|
|||
stats.processed++
|
||||
stats.usedGas += usedGas
|
||||
stats.report(chain, i, bc.stateCache.TrieDB().Size())
|
||||
if i == len(chain)-1 {
|
||||
if (bc.chainConfig.Clique != nil) && (chain[i].NumberU64()%bc.chainConfig.Clique.Epoch) == 0 {
|
||||
Checkpoint <- 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// Append a single chain head event if we've progressed the chain
|
||||
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
|
||||
|
|
@ -1422,11 +1427,9 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e
|
|||
log.Error(fmt.Sprintf(`
|
||||
########## BAD BLOCK #########
|
||||
Chain config: %v
|
||||
|
||||
Number: %v
|
||||
Hash: 0x%x
|
||||
%v
|
||||
|
||||
Error: %v
|
||||
##############################
|
||||
`, bc.chainConfig, block.Number(), block.Hash(), receiptString, err))
|
||||
|
|
|
|||
|
|
@ -488,6 +488,9 @@ 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.config.Clique != nil) && (work.Block.NumberU64()%work.config.Clique.Epoch) == 0 {
|
||||
core.Checkpoint <- 1
|
||||
}
|
||||
self.push(work)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue