From 8c313eed2614990089114bfe5fea7540f4298752 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Thu, 29 Jun 2017 13:13:00 +0300 Subject: consensus, core: EIP 100 polishes, fix chain maker diff This PR polishes the EIP 100 difficulty adjustment algorithm to match the same mechanisms as the Homestead was implemented to keep the code uniform. It also avoids a few memory allocs by reusing big1 and big2, pulling it out of the common package and into ethash. The commit also fixes chain maker to forward the uncle hash when creating a simulated chain (it wasn't needed until now so we just skipped a copy there). --- core/chain_makers.go | 1 + 1 file changed, 1 insertion(+) (limited to 'core') diff --git a/core/chain_makers.go b/core/chain_makers.go index 38a69d42a..976a8114d 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -218,6 +218,7 @@ func makeHeader(config *params.ChainConfig, parent *types.Block, state *state.St Number: parent.Number(), Time: new(big.Int).Sub(time, big.NewInt(10)), Difficulty: parent.Difficulty(), + UncleHash: parent.UncleHash(), }), GasLimit: CalcGasLimit(parent), GasUsed: new(big.Int), -- cgit