From 1363909843ce629cfe4abadff4a4fa572ca867cd Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 29 May 2018 13:38:17 +0200 Subject: [PATCH] miner: re-enable miner --- miner/worker.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 76bca3bf14..1bfcd4b02d 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -30,6 +30,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" @@ -614,11 +615,10 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, coinbase common.Address, gp *core.GasPool) (error, []*types.Log) { - return fmt.Errorf("Mining disabled"), nil - /* snap := env.state.Snapshot() - - receipt, _, err := core.ApplyTransaction(env.config, bc, &coinbase, gp, env.state, env.header, tx, &env.header.GasUsed, vm.Config{}) + //This could probably be moved to the Work-scope, and be reused + blockContext := core.NewBlockContext(env.header, coinbase, env.config) + receipt, _, err := core.ApplyTransaction(env.config, bc, gp, env.state, env.header, tx, &env.header.GasUsed, &vm.Config{}, blockContext) if err != nil { env.state.RevertToSnapshot(snap) return err, nil @@ -627,5 +627,4 @@ func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, c env.receipts = append(env.receipts, receipt) return nil, receipt.Logs - */ }