changed reconnect strategy

This commit is contained in:
cubedro 2015-04-05 21:29:34 +03:00
parent fac7978a4c
commit 4cc7d88235
1 changed files with 2 additions and 1 deletions

View File

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