diff --git a/lib/collection.js b/lib/collection.js index d3149f4..2297381 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -302,9 +302,9 @@ Collection.prototype.canNodeUpdate = function(id) 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; diff --git a/lib/history.js b/lib/history.js index 8caa69f..182c8e2 100644 --- a/lib/history.js +++ b/lib/history.js @@ -634,7 +634,8 @@ History.prototype.getCharts = 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()