This commit is contained in:
Taylor Gerring 2015-03-24 17:45:31 +01:00
parent 2106a63d60
commit 865f31018b

View File

@ -30,11 +30,11 @@ var (
type XEth struct { type XEth struct {
backend *eth.Ethereum backend *eth.Ethereum
frontend Frontend
state *State state *State
whisper *Whisper whisper *Whisper
frontend Frontend
quit chan struct{} quit chan struct{}
filterManager *filter.FilterManager filterManager *filter.FilterManager
@ -47,7 +47,6 @@ type XEth struct {
// regmut sync.Mutex // regmut sync.Mutex
// register map[string][]*interface{} // TODO improve return type // register map[string][]*interface{} // TODO improve return type
// Miner agent
agent *miner.RemoteAgent agent *miner.RemoteAgent
} }
@ -57,10 +56,10 @@ type XEth struct {
func New(eth *eth.Ethereum, frontend Frontend) *XEth { func New(eth *eth.Ethereum, frontend Frontend) *XEth {
xeth := &XEth{ xeth := &XEth{
backend: eth, backend: eth,
frontend: frontend,
whisper: NewWhisper(eth.Whisper()), whisper: NewWhisper(eth.Whisper()),
quit: make(chan struct{}), quit: make(chan struct{}),
filterManager: filter.NewFilterManager(eth.EventMux()), filterManager: filter.NewFilterManager(eth.EventMux()),
frontend: frontend,
logs: make(map[int]*logFilter), logs: make(map[int]*logFilter),
messages: make(map[int]*whisperFilter), messages: make(map[int]*whisperFilter),
agent: miner.NewRemoteAgent(), agent: miner.NewRemoteAgent(),
@ -71,6 +70,7 @@ func New(eth *eth.Ethereum, frontend Frontend) *XEth {
xeth.frontend = dummyFrontend{} xeth.frontend = dummyFrontend{}
} }
xeth.state = NewState(xeth, xeth.backend.ChainManager().TransState()) xeth.state = NewState(xeth, xeth.backend.ChainManager().TransState())
go xeth.start() go xeth.start()
go xeth.filterManager.Start() go xeth.filterManager.Start()
@ -144,6 +144,7 @@ func (self *XEth) WithState(statedb *state.StateDB) *XEth {
xeth.state = NewState(xeth, statedb) xeth.state = NewState(xeth, statedb)
return xeth return xeth
} }
func (self *XEth) State() *State { return self.state } func (self *XEth) State() *State { return self.state }
func (self *XEth) Whisper() *Whisper { return self.whisper } func (self *XEth) Whisper() *Whisper { return self.whisper }