fixed addHistory

This commit is contained in:
cubedro 2015-06-09 04:03:31 +03:00
parent 97ab08f97b
commit c0d0090d9d
2 changed files with 4 additions and 3 deletions

5
app.js
View File

@ -316,7 +316,8 @@ api.on('connection', function (spark)
{
if( !_.isUndefined(data.id) )
{
Nodes.updateLatency(data.id, data.latency, function (err, latency) {
Nodes.updateLatency(data.id, data.latency, function (err, latency)
{
if(err !== null)
{
console.error('API', 'PIN', 'Latency error:', err);
@ -333,7 +334,7 @@ api.on('connection', function (spark)
}
});
if( Nodes.requiresUpdate(data.id) && (!Nodes.askedForHistory() || _.now() - askedForHistoryTime > 60*1000) )
if( Nodes.requiresUpdate(data.id) && (!Nodes.askedForHistory() || _.now() - askedForHistoryTime > 2*60*1000) )
{
var range = Nodes.getHistory().getHistoryRequestRange();

View File

@ -118,7 +118,7 @@ Collection.prototype.addHistory = function(id, blocks, callback)
this._blockchain.add(blocks[i], id);
};
this.getCharts(callback);
this.getCharts();
}
this.askedForHistory(false);