diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 16:35:42 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 16:35:42 +0800 |
commit | ab6311c1bd38c2c90fb353bbf512f12777fd15f4 (patch) | |
tree | 67789a411277b767109f4fbc84e84d6f36f21adf /xeth/xeth.go | |
parent | d76e8cb1f126bf1f899507b6a43e4ecb4a798e54 (diff) | |
download | dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar.gz dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar.bz2 dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar.lz dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar.xz dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.tar.zst dexon-ab6311c1bd38c2c90fb353bbf512f12777fd15f4.zip |
Move remote mining agent to XEth
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r-- | xeth/xeth.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index d3c3131d4..fba61230f 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -100,6 +100,9 @@ type XEth struct { // regmut sync.Mutex // register map[string][]*interface{} // TODO improve return type + + // Miner agent + agent *Agent } // New creates an XEth that uses the given frontend. @@ -117,7 +120,10 @@ func New(eth Backend, frontend Frontend) *XEth { frontend: frontend, logs: make(map[int]*logFilter), messages: make(map[int]*whisperFilter), + agent: NewAgent(), } + eth.Miner().Register(xeth.agent) + if frontend == nil { xeth.frontend = dummyFrontend{} } @@ -164,6 +170,8 @@ func (self *XEth) stop() { func (self *XEth) DefaultGas() *big.Int { return defaultGas } func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice } +func (self *XEth) RemoteMining() *Agent { return self.agent } + func (self *XEth) AtStateNum(num int64) *XEth { chain := self.Backend().ChainManager() var block *types.Block |