From 8135752a32837748e6d4a986912131736b1a0aa0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 17 Feb 2015 12:24:51 +0100 Subject: "centralised" mining to backend. Closes #323 --- miner/miner.go | 8 ++++---- miner/worker.go | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'miner') diff --git a/miner/miner.go b/miner/miner.go index e3e7bead2..27afcf684 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -3,7 +3,7 @@ package miner import ( "math/big" - "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/pow/ezp" ) @@ -16,13 +16,13 @@ type Miner struct { MinAcceptedGasPrice *big.Int Extra string - coinbase []byte + Coinbase []byte mining bool } -func New(coinbase []byte, eth *eth.Ethereum) *Miner { +func New(coinbase []byte, eth core.Backend) *Miner { miner := &Miner{ - coinbase: coinbase, + Coinbase: coinbase, worker: newWorker(coinbase, eth), } diff --git a/miner/worker.go b/miner/worker.go index 2b64f3210..47b462e53 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/pow" @@ -25,7 +24,7 @@ type environment struct { uncles *set.Set } -func env(block *types.Block, eth *eth.Ethereum) *environment { +func env(block *types.Block, eth core.Backend) *environment { state := state.New(block.Root(), eth.Db()) env := &environment{ totalUsedGas: new(big.Int), @@ -63,7 +62,7 @@ type worker struct { quit chan struct{} pow pow.PoW - eth *eth.Ethereum + eth core.Backend chain *core.ChainManager proc *core.BlockProcessor coinbase []byte @@ -73,7 +72,7 @@ type worker struct { mining bool } -func newWorker(coinbase []byte, eth *eth.Ethereum) *worker { +func newWorker(coinbase []byte, eth core.Backend) *worker { return &worker{ eth: eth, mux: eth.EventMux(), -- cgit