Merge pull request #121 from cubedro/develop

Fixed negative block time bug
This commit is contained in:
Marian OANCΞA 2015-05-11 21:40:36 +03:00
commit 27b1be1369

View File

@ -71,10 +71,10 @@ History.prototype.add = function(block, id)
if( prevBlock )
{
block.time = block.arrived - prevBlock.block.arrived;
block.time = Math.max(block.arrived - prevBlock.block.arrived, 0);
if(block.number < this.bestBlock().height)
block.time = (block.timestamp - prevBlock.block.timestamp) * 1000;
block.time = Math.max((block.timestamp - prevBlock.block.timestamp) * 1000, 0);
}
else
{