diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-07 18:32:55 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-07 18:32:55 +0800 |
commit | 7b6a8cc9ae56856f1c292243b57d658b67b92621 (patch) | |
tree | e959e2d89dc88c00c288a97ac659843b5e06f0bf /miner/miner.go | |
parent | 9c55576c7b415954773c062d404a736741fb9794 (diff) | |
download | dexon-7b6a8cc9ae56856f1c292243b57d658b67b92621.tar.gz dexon-7b6a8cc9ae56856f1c292243b57d658b67b92621.tar.zst dexon-7b6a8cc9ae56856f1c292243b57d658b67b92621.zip |
Fixed pending states
Diffstat (limited to 'miner/miner.go')
-rw-r--r-- | miner/miner.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/miner/miner.go b/miner/miner.go index 23e48db40..aa6c059ba 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -6,6 +6,8 @@ import ( "github.com/ethereum/ethash" "github.com/ethereum/go-ethereum/common" "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/pow" ) @@ -26,6 +28,7 @@ func New(eth core.Backend, pow pow.PoW, minerThreads int) *Miner { for i := 0; i < minerThreads; i++ { miner.worker.register(NewCpuMiner(i, pow)) } + return miner } @@ -40,6 +43,7 @@ func (self *Miner) Start(coinbase common.Address) { self.pow.(*ethash.Ethash).UpdateDAG() self.worker.start() + self.worker.commitNewWork() } @@ -61,3 +65,11 @@ func (self *Miner) HashRate() int64 { func (self *Miner) SetExtra(extra []byte) { self.worker.extra = extra } + +func (self *Miner) PendingState() *state.StateDB { + return self.worker.pendingState() +} + +func (self *Miner) PendingBlock() *types.Block { + return self.worker.pendingBlock() +} |