aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-11 16:53:53 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-11 16:53:53 +0800
commit0ad5898c0f9b0d777818d89356b74606f4b3c988 (patch)
treedce4e31dedd9e92f26c5203d0f62dc4ae2d59044 /xeth/xeth.go
parent00280e62e3c422b2824a0280015b7b78578ab16d (diff)
downloadgo-tangerine-0ad5898c0f9b0d777818d89356b74606f4b3c988.tar.gz
go-tangerine-0ad5898c0f9b0d777818d89356b74606f4b3c988.tar.zst
go-tangerine-0ad5898c0f9b0d777818d89356b74606f4b3c988.zip
rpc, xeth: fix #881, gracefully handle offline whisper
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index ad8596803..b875fa6f1 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -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{}