Skip to content

Commit bdc192e

Browse files
committed
Merge pull request cubedro#234 from cubedro/develop
Updated web3 and fixed sync issue
2 parents 5029c39 + 5d310fc commit bdc192e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/node.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var UPDATE_INTERVAL = 5000;
3131
var PING_INTERVAL = 3000;
3232
var MINERS_LIMIT = 5;
3333
var MAX_HISTORY_UPDATE = 50;
34-
var MAX_CONNECTION_ATTEMPTS = 30;
34+
var MAX_CONNECTION_ATTEMPTS = 50;
3535
var CONNECTION_ATTEMPTS_TIMEOUT = 1000;
3636

3737
Socket = Primus.createSocket({
@@ -134,7 +134,8 @@ Node.prototype.startWeb3Connection = function()
134134
{
135135
console.info('Starting web3 connection');
136136

137-
web3 = new Web3(new Web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8545')));
137+
web3 = new Web3();
138+
web3.setProvider(new web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8545')));
138139

139140
this.checkWeb3Connection();
140141
}
@@ -733,6 +734,8 @@ Node.prototype.setWatches = function()
733734
console.info("SYNC UPDATE:", sync);
734735
} else {
735736
console.info("SYNC STOPPED:", sync);
737+
self.stats.syncing = false;
738+
self.setFilters();
736739
}
737740
} else {
738741
self.stats.syncing = false;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eth-net-intelligence-api",
33
"description": "Ethereum Network Intelligence API",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"private": true,
66
"main": "./app.js",
77
"directories": {
@@ -16,7 +16,7 @@
1616
"primus": "4.0.5",
1717
"primus-emit": "1.0.0",
1818
"primus-spark-latency": "0.1.1",
19-
"web3": "0.15.1",
19+
"web3": "0.15.3",
2020
"ws": "^1.0.1"
2121
},
2222
"scripts": {

0 commit comments

Comments
 (0)