Merge branch 'master' of https://github.com/cubedro/eth-netstats
This commit is contained in:
@@ -32,6 +32,7 @@ var Node = function(data)
|
||||
transactions: [],
|
||||
uncles: []
|
||||
},
|
||||
syncing: false,
|
||||
propagationAvg: 0,
|
||||
latency: 0,
|
||||
uptime: 100
|
||||
@@ -113,6 +114,7 @@ Node.prototype.getInfo = function(callback)
|
||||
stats: {
|
||||
active: this.stats.active,
|
||||
mining: this.stats.mining,
|
||||
syncing: this.stats.syncing,
|
||||
hashrate: this.stats.hashrate,
|
||||
peers: this.stats.peers,
|
||||
gasPrice: this.stats.gasPrice,
|
||||
@@ -235,6 +237,7 @@ Node.prototype.setBasicStats = function(stats, callback)
|
||||
{
|
||||
this.stats.active = stats.active;
|
||||
this.stats.mining = stats.mining;
|
||||
this.stats.syncing = (!_.isUndefined(stats.syncing) ? stats.syncing : false);
|
||||
this.stats.hashrate = stats.hashrate;
|
||||
this.stats.peers = stats.peers;
|
||||
this.stats.gasPrice = stats.gasPrice;
|
||||
@@ -284,6 +287,7 @@ Node.prototype.getStats = function()
|
||||
stats: {
|
||||
active: this.stats.active,
|
||||
mining: this.stats.mining,
|
||||
syncing: this.stats.syncing,
|
||||
hashrate: this.stats.hashrate,
|
||||
peers: this.stats.peers,
|
||||
gasPrice: this.stats.gasPrice,
|
||||
@@ -314,6 +318,7 @@ Node.prototype.getBasicStats = function()
|
||||
stats: {
|
||||
active: this.stats.active,
|
||||
mining: this.stats.mining,
|
||||
syncing: this.stats.syncing,
|
||||
hashrate: this.stats.hashrate,
|
||||
peers: this.stats.peers,
|
||||
gasPrice: this.stats.gasPrice,
|
||||
@@ -370,7 +375,7 @@ Node.prototype.getBlockNumber = function()
|
||||
Node.prototype.canUpdate = function()
|
||||
{
|
||||
// return (this.info.canUpdateHistory && this.trusted) || false;
|
||||
return (this.info.canUpdateHistory) || false;
|
||||
return (this.info.canUpdateHistory || (this.stats.syncing === false && this.stats.peers > 0)) || false;
|
||||
}
|
||||
|
||||
Node.prototype.isInactiveAndOld = function()
|
||||
|
||||
Reference in New Issue
Block a user