aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 23:28:11 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 23:29:53 +0800
commit0316490c54249617fa653d5114227f6b8078d297 (patch)
treed73a4963ea4860c8a6e3bde9babd28f405010901 /lib
parent838ca2fd9393e5b3cd4423934de78f1b8f9fd13f (diff)
downloaddexon-0316490c54249617fa653d5114227f6b8078d297.tar.gz
dexon-0316490c54249617fa653d5114227f6b8078d297.tar.zst
dexon-0316490c54249617fa653d5114227f6b8078d297.zip
common fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/autoprovider.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/autoprovider.js b/lib/autoprovider.js
index b05d4190a..470861686 100644
--- a/lib/autoprovider.js
+++ b/lib/autoprovider.js
@@ -28,9 +28,6 @@
*/
if (process.env.NODE_ENV !== 'build') {
var WebSocket = require('ws'); // jshint ignore:line
-}
-
-if (process.env.NODE_ENV !== 'build') {
var web3 = require('./web3'); // jshint ignore:line
}
@@ -59,10 +56,10 @@ var AutoProvider = function (userOptions) {
ws.close();
if (success) {
self.provider = new web3.providers.WebSocketProvider(options.websockets);
- return;
+ } else {
+ self.provider = new web3.providers.HttpRpcProvider(options.httprpc);
+ self.poll = self.provider.poll.bind(self.provider);
}
- self.provider = new web3.providers.HttpRpcProvider(options.httprpc);
- self.poll = self.provider.poll.bind(self.provider);
self.sendQueue.forEach(function (payload) {
self.provider(payload);
});