miner: re-enable miner

This commit is contained in:
Martin Holst Swende 2018-05-29 13:38:17 +02:00
parent 58e01e4058
commit 1363909843
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types" "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/ethdb"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log" "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) { 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() snap := env.state.Snapshot()
//This could probably be moved to the Work-scope, and be reused
receipt, _, err := core.ApplyTransaction(env.config, bc, &coinbase, gp, env.state, env.header, tx, &env.header.GasUsed, vm.Config{}) 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 { if err != nil {
env.state.RevertToSnapshot(snap) env.state.RevertToSnapshot(snap)
return err, nil return err, nil
@ -627,5 +627,4 @@ func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, c
env.receipts = append(env.receipts, receipt) env.receipts = append(env.receipts, receipt)
return nil, receipt.Logs return nil, receipt.Logs
*/
} }