Fix block history if chain is shorted than MAX_HISTORY.

pull/5/head
Péter Szilágyi 8 years ago committed by EOS Classic
parent 43f5d65766
commit 31a3f84214
No known key found for this signature in database
GPG Key ID: 0D626A44301D8C5E
  1. 2
      lib/history.js

@ -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…
Cancel
Save