Fix block history if chain is shorted than MAX_HISTORY.
This commit is contained in:
parent
5d3ed04c55
commit
73f4d4978d
@ -169,7 +169,7 @@ History.prototype.add = function(block, id, trusted, addingHistory)
|
||||
propagTimes: []
|
||||
}
|
||||
|
||||
if( this._items.length === 0 || (this._items.length === MAX_HISTORY && block.number > this.worstBlockNumber()) || (this._items.length < MAX_HISTORY && block.number < this.bestBlockNumber() && addingHistory) )
|
||||
if( this._items.length === 0 || (this._items.length > 0 && block.number > this.worstBlockNumber()) || (this._items.length < MAX_HISTORY && block.number < this.bestBlockNumber() && addingHistory) )
|
||||
{
|
||||
item.propagTimes.push({
|
||||
node: id,
|
||||
|
Loading…
Reference in New Issue
Block a user