From 4cc7d88235a8beb9eaefc714ad3bde80998259d3 Mon Sep 17 00:00:00 2001 From: cubedro Date: Sun, 5 Apr 2015 21:29:34 +0300 Subject: [PATCH] changed reconnect strategy --- lib/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index c65f2e9..446101b 100644 --- a/lib/node.js +++ b/lib/node.js @@ -20,6 +20,7 @@ Socket = Primus.createSocket({ transformer: 'websockets', pathname: '/api', timeout: 10000, + strategy: 'disconnect,online', plugin: {emitter: Emitter, sparkLatency: Latency} }); @@ -238,7 +239,7 @@ Node.prototype.getLatestBlocks = function() Node.prototype.addBlockHistory = function(block) { - if(this.blocks.length === 0 || block.number !== this.blocks[0].number) + if(this.blocks.length === 0 || (block !== null && block.number !== this.blocks[0].number)) { if(this.blocks.length === MAX_BLOCKS_HISTORY) {