aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 75d83f80b..27435b956 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/whisper"
@@ -27,13 +28,13 @@ type Backend interface {
ChainManager() *core.ChainManager
TxPool() *core.TxPool
PeerCount() int
- IsMining() bool
IsListening() bool
Peers() []*p2p.Peer
KeyManager() *crypto.KeyManager
Db() ethutil.Database
EventMux() *event.TypeMux
Whisper() *whisper.Whisper
+ Miner() *miner.Miner
}
type XEth struct {
@@ -42,6 +43,7 @@ type XEth struct {
chainManager *core.ChainManager
state *State
whisper *Whisper
+ miner *miner.Miner
}
func New(eth Backend) *XEth {
@@ -50,15 +52,17 @@ func New(eth Backend) *XEth {
blockProcessor: eth.BlockProcessor(),
chainManager: eth.ChainManager(),
whisper: NewWhisper(eth.Whisper()),
+ miner: eth.Miner(),
}
xeth.state = NewState(xeth)
return xeth
}
-func (self *XEth) Backend() Backend { return self.eth }
-func (self *XEth) State() *State { return self.state }
-func (self *XEth) Whisper() *Whisper { return self.whisper }
+func (self *XEth) Backend() Backend { return self.eth }
+func (self *XEth) State() *State { return self.state }
+func (self *XEth) Whisper() *Whisper { return self.whisper }
+func (self *XEth) Miner() *miner.Miner { return self.miner }
func (self *XEth) BlockByHash(strHash string) *Block {
hash := fromHex(strHash)
@@ -96,7 +100,7 @@ func (self *XEth) PeerCount() int {
}
func (self *XEth) IsMining() bool {
- return self.eth.IsMining()
+ return self.miner.Mining()
}
func (self *XEth) IsListening() bool {