added pending as a separate call
This commit is contained in:
@@ -39,6 +39,16 @@ Collection.prototype.update = function(id, stats)
|
||||
return node.setStats(stats, propagationHistory);
|
||||
}
|
||||
|
||||
Collection.prototype.updatePending = function(id, stats)
|
||||
{
|
||||
var node = this.getNode({ id: id });
|
||||
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
return node.setPending(stats);
|
||||
}
|
||||
|
||||
Collection.prototype.addHistory = function(id, blocks)
|
||||
{
|
||||
var node = this.getNode({ id: id });
|
||||
|
||||
@@ -130,6 +130,9 @@ Node.prototype.setStats = function(stats, history)
|
||||
else
|
||||
stats.propagationAvg = 0;
|
||||
|
||||
if( !_.isUndefined(this.stats.latency) )
|
||||
stats.latency = this.stats.latency;
|
||||
|
||||
this.stats = stats;
|
||||
|
||||
return this.getStats();
|
||||
@@ -138,6 +141,21 @@ Node.prototype.setStats = function(stats, history)
|
||||
return false;
|
||||
}
|
||||
|
||||
Node.prototype.setPending = function(stats)
|
||||
{
|
||||
if( !_.isUndefined(stats) && !_.isUndefined(stats.pending) )
|
||||
{
|
||||
this.stats.pending = stats.pending;
|
||||
|
||||
return {
|
||||
id: this.id,
|
||||
pending: this.stats.pending
|
||||
};
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Node.prototype.setLatency = function(latency)
|
||||
{
|
||||
if( !_.isUndefined(latency) )
|
||||
|
||||
Reference in New Issue
Block a user