aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-06-29 18:13:00 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-06-30 21:42:09 +0800
commit8c313eed2614990089114bfe5fea7540f4298752 (patch)
treefb9a3dce669d15f8dcc9958dae73e6d935699b99 /core/chain_makers.go
parentc4d28aee9bb3ce7851e92462bb2e7fdbf88f9a9a (diff)
downloaddexon-8c313eed2614990089114bfe5fea7540f4298752.tar.gz
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/chain_makers.go')
-rw-r--r--core/chain_makers.go1
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),