performance improvements

This commit is contained in:
cubedro
2015-06-13 12:54:34 +03:00
parent 9b7efefb70
commit fbf1aa407d
6 changed files with 33 additions and 12 deletions

View File

@@ -287,7 +287,7 @@ Collection.prototype.canNodeUpdate = function(id)
Collection.prototype.requiresUpdate = function(id)
{
return ( this.canNodeUpdate(id) && this._blockchain.requiresUpdate() );
return ( this.canNodeUpdate(id) && this._blockchain.requiresUpdate() && (!this._askedForHistory || _.now() - this._askedForHistoryTime > 2*60*1000) );
}
Collection.prototype.askedForHistory = function(set)

View File

@@ -290,7 +290,8 @@ Node.prototype.getStats = function()
block: this.stats.block,
propagationAvg: this.stats.propagationAvg,
uptime: this.stats.uptime,
pending: this.stats.pending
pending: this.stats.pending,
latency: this.stats.latency
},
history: this.history
};
@@ -316,7 +317,8 @@ Node.prototype.getBasicStats = function()
hashrate: this.stats.hashrate,
peers: this.stats.peers,
gasPrice: this.stats.gasPrice,
uptime: this.stats.uptime
uptime: this.stats.uptime,
latency: this.stats.latency
}
};
}