Merge pull request #26 from hyperion-hyn/master
fix block history sorting bug
This commit is contained in:
commit
6cc92b0e54
@ -228,7 +228,7 @@ History.prototype._save = function(block)
|
|||||||
{
|
{
|
||||||
this._items.unshift(block);
|
this._items.unshift(block);
|
||||||
|
|
||||||
this._items = _.sortBy( this._items, 'height', false );
|
this._items = _.orderBy( this._items, 'height', "desc" );
|
||||||
|
|
||||||
if(this._items.length > MAX_HISTORY)
|
if(this._items.length > MAX_HISTORY)
|
||||||
{
|
{
|
||||||
@ -591,7 +591,7 @@ History.prototype.getCharts = function()
|
|||||||
if(this._callback !== null)
|
if(this._callback !== null)
|
||||||
{
|
{
|
||||||
var chartHistory = _( this._items )
|
var chartHistory = _( this._items )
|
||||||
.sortBy( 'height', false )
|
.orderBy( 'height', "desc" )
|
||||||
// .filter(function (item)
|
// .filter(function (item)
|
||||||
// {
|
// {
|
||||||
// return item.block.trusted;
|
// return item.block.trusted;
|
||||||
|
Loading…
Reference in New Issue
Block a user