Merge pull request #121 from cubedro/develop
Fixed negative block time bug
This commit is contained in:
commit
27b1be1369
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user