rpc, xeth: fix #881, gracefully handle offline whisper
This commit is contained in:
@ -79,7 +79,6 @@ func New(eth *eth.Ethereum, frontend Frontend) *XEth {
|
||||
xeth := &XEth{
|
||||
backend: eth,
|
||||
frontend: frontend,
|
||||
whisper: NewWhisper(eth.Whisper()),
|
||||
quit: make(chan struct{}),
|
||||
filterManager: filter.NewFilterManager(eth.EventMux()),
|
||||
logQueue: make(map[int]*logQueue),
|
||||
@ -88,6 +87,9 @@ func New(eth *eth.Ethereum, frontend Frontend) *XEth {
|
||||
messages: make(map[int]*whisperFilter),
|
||||
agent: miner.NewRemoteAgent(),
|
||||
}
|
||||
if eth.Whisper() != nil {
|
||||
xeth.whisper = NewWhisper(eth.Whisper())
|
||||
}
|
||||
eth.Miner().Register(xeth.agent)
|
||||
if frontend == nil {
|
||||
xeth.frontend = dummyFrontend{}
|
||||
|
Reference in New Issue
Block a user