From 49a93a71e6de8953c8139a80d0a32e28121717bb Mon Sep 17 00:00:00 2001 From: Luke Williams Date: Sat, 9 Mar 2019 07:59:39 +0100 Subject: [PATCH] core/chain_makers: update params passed to ubqhash.AccumulateRewards and ubqhash.CalcDifficultyLegacy --- core/chain_makers.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/chain_makers.go b/core/chain_makers.go index a18538082d..f0cbd950a6 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -22,7 +22,6 @@ import ( "github.com/ubiq/go-ubiq/common" "github.com/ubiq/go-ubiq/consensus/ubqhash" - "github.com/ubiq/go-ubiq/consensus/misc" "github.com/ubiq/go-ubiq/core/state" "github.com/ubiq/go-ubiq/core/types" "github.com/ubiq/go-ubiq/core/vm" @@ -168,7 +167,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, db ethdb.Dat if gen != nil { gen(i, b) } - ubqhash.AccumulateRewards(config, statedb, h, b.uncles) + ubqhash.AccumulateRewards(statedb, h, b.uncles) root, err := statedb.CommitTo(db, config.IsEIP158(h.Number)) if err != nil { panic(fmt.Sprintf("state write error: %v", err)) @@ -202,12 +201,7 @@ func makeHeader(config *params.ChainConfig, parent *types.Block, state *state.St Root: state.IntermediateRoot(config.IsEIP158(parent.Number())), ParentHash: parent.Hash(), Coinbase: parent.Coinbase(), - Difficulty: ubqhash.CalcDifficultyLegacy(config, time.Uint64(), &types.Header{ - Number: parent.Number(), - Time: new(big.Int).Sub(time, big.NewInt(10)), - Difficulty: parent.Difficulty(), - UncleHash: parent.UncleHash(), - }), + Difficulty: ubqhash.CalcDifficultyLegacy(time.Uint64(), new(big.Int).Sub(time, big.NewInt(10)).Uint64(), parent.Number(), parent.Difficulty()), GasLimit: CalcGasLimit(parent), GasUsed: new(big.Int), Number: new(big.Int).Add(parent.Number(), common.Big1),