From 3d4ef1d0cfc82d3645ebbfa7bb79e025a8aa9525 Mon Sep 17 00:00:00 2001 From: cubedro Date: Sun, 5 Apr 2015 19:30:26 +0300 Subject: [PATCH] fixed propagation best block bug --- models/collection.js | 2 +- models/node.js | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/models/collection.js b/models/collection.js index ed68c68..686e1d6 100644 --- a/models/collection.js +++ b/models/collection.js @@ -38,7 +38,7 @@ Collection.prototype.update = function(id, stats) { stats.block.received = (new Date()).getTime(); - if(this._bestBlock.number < oldStats.stats.block.number) + if(this._bestBlock.number < stats.block.number) { stats.block.propagation = 0; this._bestBlock = stats.block; diff --git a/models/node.js b/models/node.js index 2fd3bf8..1532ea9 100644 --- a/models/node.js +++ b/models/node.js @@ -90,11 +90,6 @@ Node.prototype.setStats = function(stats) { if(typeof stats !== 'undefined' && typeof stats.block !== 'undefined' && typeof stats.block.number !== 'undefined') { - // if(stats.block.number !== this.stats.block.number) { - // stats.block.received = (new Date()).getTime(); - // } else { - // stats.block.received = this.stats.block.received; - // } stats.block.hash = stats.block.hash.replace('0x', ''); this.stats = stats;