From 868b93373c934015cb89dfb12b0f47e82090489d Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 2 Jun 2015 00:21:09 +0300 Subject: [PATCH] added duplicate block difference check --- lib/node.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index 7438b29..742adaf 100644 --- a/lib/node.js +++ b/lib/node.js @@ -394,7 +394,12 @@ Node.prototype.validateLatestBlock = function (error, result, timeString) { console.warn("==>", "Got same block:", chalk.reset.cyan(block.number)); - return false; + if( _.isEqual(JSON.stringify(this.stats.block), JSON.stringify(block)) ) + return false; + + console.log(this.stats.block); + console.log(block); + console.warn("Blocks are different... updating block"); } console.success("==>", "Got block:", chalk.reset.red(block.number));