performance improvements
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user