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) {