mirror of https://github.com/embarklabs/embark.git
fix(whisper): fix crash on using whisper with the simualtor
This commit is contained in:
parent
89c9b1f0ef
commit
1461e95c39
|
@ -30,6 +30,14 @@ class Whisper {
|
||||||
this.connectToProvider();
|
this.connectToProvider();
|
||||||
|
|
||||||
this.events.request('processes:register', 'whisper', (cb) => {
|
this.events.request('processes:register', 'whisper', (cb) => {
|
||||||
|
this.web3.shh.getInfo((err) => {
|
||||||
|
if (err) {
|
||||||
|
const message = err.message || err;
|
||||||
|
if (message.indexOf('not supported') > -1) {
|
||||||
|
this.logger.error('Whisper is not supported on your node. Are you using the simulator?');
|
||||||
|
return this.logger.trace(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.setServiceCheck();
|
this.setServiceCheck();
|
||||||
this.addWhisperToEmbarkJS();
|
this.addWhisperToEmbarkJS();
|
||||||
this.addSetProvider();
|
this.addSetProvider();
|
||||||
|
@ -38,6 +46,7 @@ class Whisper {
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.events.request('processes:launch', 'whisper');
|
this.events.request('processes:launch', 'whisper');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue