Move remote mining agent to XEth

This commit is contained in:
Taylor Gerring
2015-03-23 09:35:42 +01:00
parent d76e8cb1f1
commit ab6311c1bd
3 changed files with 93 additions and 9 deletions

View File

@ -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