From 6ec6b290511a7433a36a40d1e8c2cca3d9613d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 10 May 2019 17:04:10 +0300 Subject: core: fix import errors on clique crashes + empty blocks (#19544) * core: fix import errors on clique crashes + empty blocks * cosensus/clique, core: add test for the mirrored state issue * core: address todo question wrt log count * core: raise a louder warning for non-clique known blocks --- core/chain_makers.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/chain_makers.go') diff --git a/core/chain_makers.go b/core/chain_makers.go index 754b543c7..17f404211 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -71,6 +71,13 @@ func (b *BlockGen) SetNonce(nonce types.BlockNonce) { b.header.Nonce = nonce } +// SetDifficulty sets the difficulty field of the generated block. This method is +// useful for Clique tests where the difficulty does not depend on time. For the +// ethash tests, please use OffsetTime, which implicitly recalculates the diff. +func (b *BlockGen) SetDifficulty(diff *big.Int) { + b.header.Difficulty = diff +} + // AddTx adds a transaction to the generated block. If no coinbase has // been set, the block's coinbase is set to the zero address. // -- cgit v1.2.3