diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-06-29 18:13:00 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-06-30 21:42:09 +0800 |
commit | 8c313eed2614990089114bfe5fea7540f4298752 (patch) | |
tree | fb9a3dce669d15f8dcc9958dae73e6d935699b99 /core | |
parent | c4d28aee9bb3ce7851e92462bb2e7fdbf88f9a9a (diff) | |
download | dexon-8c313eed2614990089114bfe5fea7540f4298752.tar dexon-8c313eed2614990089114bfe5fea7540f4298752.tar.gz dexon-8c313eed2614990089114bfe5fea7540f4298752.tar.bz2 dexon-8c313eed2614990089114bfe5fea7540f4298752.tar.lz dexon-8c313eed2614990089114bfe5fea7540f4298752.tar.xz dexon-8c313eed2614990089114bfe5fea7540f4298752.tar.zst dexon-8c313eed2614990089114bfe5fea7540f4298752.zip |
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).
Diffstat (limited to 'core')
-rw-r--r-- | core/chain_makers.go | 1 |
1 files changed, 1 insertions, 0 deletions
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), |