From 1c1303f87ab33a914b1882fcd224aff374a5fe75 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 27 May 2015 12:22:17 +0300 Subject: [PATCH 1/2] moved ordering before delete --- models/history.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/history.js b/models/history.js index 3bee4ee..fcec0b1 100644 --- a/models/history.js +++ b/models/history.js @@ -109,12 +109,12 @@ History.prototype._save = function(block) { this._items.unshift(block); + this._items = _.sortByOrder( this._items, 'height', false ); + if(this._items.length > MAX_HISTORY) { this._items.pop(); } - - this._items = _.sortByOrder( this._items, 'height', false ); } History.prototype.search = function(number) From aaa418adfd81f67a469d13f22155abb0cc8397a0 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 27 May 2015 12:22:53 +0300 Subject: [PATCH 2/2] version 0.0.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f74b9aa..f904a35 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eth-netstats", "description": "Ethereum Network Intelligence dashboard", - "version": "0.0.6", + "version": "0.0.7", "private": true, "engines": { "node": "0.12.0",