changed direction of history iteration
This commit is contained in:
parent
3f962fb9a8
commit
9d8b1483fe
@ -46,7 +46,8 @@ Collection.prototype.addHistory = function(id, blocks)
|
|||||||
if(!node)
|
if(!node)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
console.log(blocks);
|
blocks = blocks.reverse();
|
||||||
|
|
||||||
for (var i = 0; i <= blocks.length - 1; i++)
|
for (var i = 0; i <= blocks.length - 1; i++)
|
||||||
{
|
{
|
||||||
this._blockchain.add(blocks[i], id);
|
this._blockchain.add(blocks[i], id);
|
||||||
|
@ -388,9 +388,7 @@ History.prototype.getHistoryRequestRange = function()
|
|||||||
|
|
||||||
var missing = _.difference( range, blocks );
|
var missing = _.difference( range, blocks );
|
||||||
|
|
||||||
console.log('missing', missing.join(', '));
|
var max = _.max(missing);
|
||||||
|
|
||||||
var max = _.min(this._items, 'height').height - 1;
|
|
||||||
var min = max - Math.min( 50, (MAX_HISTORY - this._items.length + 1) ) + 1;
|
var min = max - Math.min( 50, (MAX_HISTORY - this._items.length + 1) ) + 1;
|
||||||
|
|
||||||
return {max: max, min: min};
|
return {max: max, min: min};
|
||||||
|
Loading…
Reference in New Issue
Block a user