updated web3 and fixed sync issue

This commit is contained in:
cubedro 2016-04-07 19:50:57 +03:00
parent 7c455a2127
commit 5d310fcdcd
2 changed files with 7 additions and 4 deletions

View File

@ -31,7 +31,7 @@ var UPDATE_INTERVAL = 5000;
var PING_INTERVAL = 3000; var PING_INTERVAL = 3000;
var MINERS_LIMIT = 5; var MINERS_LIMIT = 5;
var MAX_HISTORY_UPDATE = 50; var MAX_HISTORY_UPDATE = 50;
var MAX_CONNECTION_ATTEMPTS = 30; var MAX_CONNECTION_ATTEMPTS = 50;
var CONNECTION_ATTEMPTS_TIMEOUT = 1000; var CONNECTION_ATTEMPTS_TIMEOUT = 1000;
Socket = Primus.createSocket({ Socket = Primus.createSocket({
@ -134,7 +134,8 @@ Node.prototype.startWeb3Connection = function()
{ {
console.info('Starting web3 connection'); console.info('Starting web3 connection');
web3 = new Web3(new Web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8545'))); web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8545')));
this.checkWeb3Connection(); this.checkWeb3Connection();
} }
@ -733,6 +734,8 @@ Node.prototype.setWatches = function()
console.info("SYNC UPDATE:", sync); console.info("SYNC UPDATE:", sync);
} else { } else {
console.info("SYNC STOPPED:", sync); console.info("SYNC STOPPED:", sync);
self.stats.syncing = false;
self.setFilters();
} }
} else { } else {
self.stats.syncing = false; self.stats.syncing = false;

View File

@ -1,7 +1,7 @@
{ {
"name": "eth-net-intelligence-api", "name": "eth-net-intelligence-api",
"description": "Ethereum Network Intelligence API", "description": "Ethereum Network Intelligence API",
"version": "0.1.0", "version": "0.1.1",
"private": true, "private": true,
"main": "./app.js", "main": "./app.js",
"directories": { "directories": {
@ -16,7 +16,7 @@
"primus": "4.0.5", "primus": "4.0.5",
"primus-emit": "1.0.0", "primus-emit": "1.0.0",
"primus-spark-latency": "0.1.1", "primus-spark-latency": "0.1.1",
"web3": "0.15.1", "web3": "0.15.3",
"ws": "^1.0.1" "ws": "^1.0.1"
}, },
"scripts": { "scripts": {