Remove useless try on ws connect
This commit is contained in:
parent
81c914b5a2
commit
fe3e4690f6
|
@ -13,6 +13,7 @@ __embarkWhisperNewWeb3.setProvider = function (options) {
|
||||||
}
|
}
|
||||||
// TODO: take into account type
|
// TODO: take into account type
|
||||||
self.web3 = new Web3(new Web3.providers.WebsocketProvider("ws://" + provider, options.providerOptions));
|
self.web3 = new Web3(new Web3.providers.WebsocketProvider("ws://" + provider, options.providerOptions));
|
||||||
|
self.web3.currentProvider.on('connect', () => {
|
||||||
self.getWhisperVersion(function (err, version) {
|
self.getWhisperVersion(function (err, version) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log("whisper not available");
|
console.log("whisper not available");
|
||||||
|
@ -28,6 +29,10 @@ __embarkWhisperNewWeb3.setProvider = function (options) {
|
||||||
}
|
}
|
||||||
self.whisperVersion = self.web3.version.whisper;
|
self.whisperVersion = self.web3.version.whisper;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
self.web3.currentProvider.on('error', () => {
|
||||||
|
console.log("whisper not available");
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
__embarkWhisperNewWeb3.sendMessage = function (options) {
|
__embarkWhisperNewWeb3.sendMessage = function (options) {
|
||||||
|
|
Loading…
Reference in New Issue