better history handling

pull/5/head
cubedro 8 years ago
parent a8920773f8
commit 1c1cb25d63
  1. 4
      lib/collection.js
  2. 3
      lib/history.js

@ -302,9 +302,9 @@ Collection.prototype.canNodeUpdate = function(id)
if(node.canUpdate()) if(node.canUpdate())
{ {
var diff = this._blockchain.bestBlockNumber() - node.getBlockNumber(); var diff = node.getBlockNumber() - this._blockchain.bestBlockNumber();
return (diff <= 0); return Boolean(diff >= 0);
} }
return false; return false;

@ -634,7 +634,8 @@ History.prototype.getCharts = function()
History.prototype.requiresUpdate = function() History.prototype.requiresUpdate = function()
{ {
return ( this._items.length < MAX_HISTORY && !_.isEmpty(this._items) ); // return ( this._items.length < MAX_HISTORY && !_.isEmpty(this._items) );
return ( this._items.length < MAX_HISTORY );
} }
History.prototype.getHistoryRequestRange = function() History.prototype.getHistoryRequestRange = function()

Loading…
Cancel
Save