fixed propagation bug

This commit is contained in:
cubedro 2015-06-09 03:57:56 +03:00
parent ca513d71dd
commit 97ab08f97b
4 changed files with 7 additions and 9 deletions

2
app.js
View File

@ -333,7 +333,7 @@ api.on('connection', function (spark)
} }
}); });
if( Nodes.requiresUpdate(data.id) && (!Nodes.askedForHistory() || _.now() - askedForHistoryTime > 200000) ) if( Nodes.requiresUpdate(data.id) && (!Nodes.askedForHistory() || _.now() - askedForHistoryTime > 60*1000) )
{ {
var range = Nodes.getHistory().getHistoryRequestRange(); var range = Nodes.getHistory().getHistoryRequestRange();

View File

@ -61,7 +61,6 @@ Collection.prototype.addBlock = function(id, stats, callback)
if (!block) if (!block)
{ {
console.log(block);
callback('Block undefined', null); callback('Block undefined', null);
} }
else else

View File

@ -110,14 +110,14 @@ History.prototype.add = function(block, id)
block.time = 0; block.time = 0;
} }
if( this._items.length === 0 || block.number >= (this.bestBlockNumber() - MAX_HISTORY + 1) )
{
var item = { var item = {
height: block.number, height: block.number,
block: block, block: block,
propagTimes: [] propagTimes: []
} }
if( this._items.length === 0 || block.number >= (this.bestBlockNumber() - MAX_HISTORY + 1) )
{
item.propagTimes.push({ item.propagTimes.push({
node: id, node: id,
received: now, received: now,

View File

@ -158,7 +158,6 @@ Node.prototype.setBlock = function(block, history, callback)
} }
else else
{ {
console.log(block);
callback('Block undefined', null); callback('Block undefined', null);
} }
} }