From c26ba17cd46a3113d621e0ca442f07158719aea0 Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 9 Jun 2015 05:06:00 +0300 Subject: [PATCH] added bad block check --- lib/history.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/history.js b/lib/history.js index 0e3367a..d64cb07 100644 --- a/lib/history.js +++ b/lib/history.js @@ -126,6 +126,20 @@ History.prototype.add = function(block, id) this._save(item); + changed = true; + } + else if(this._items.length > 0 && block.arrived - this.bestBlock().arrived > 10*60*1000) + { + this._items.splice(0,1); + + item.propagTimes.push({ + node: id, + received: now, + propagation: block.propagation + }); + + this._save(item); + changed = true; } }