diff --git a/lib/pool.js b/lib/pool.js index d604070..2d0ca08 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -154,8 +154,8 @@ var pool = module.exports = function pool(options, authorizeFn){ if (error) emitErrorLog('system', 'Error with initial getblocktemplate'); else{ - StartStratumServer(); SetupBlockPolling(); + StartStratumServer(); } }); }); diff --git a/lib/stratum.js b/lib/stratum.js index 403ffc3..2ec91d8 100644 --- a/lib/stratum.js +++ b/lib/stratum.js @@ -178,8 +178,11 @@ var StratumClient = function(options){ socket.on('end', function() { _this.emit('socketDisconnect') }); - socket.on('error', function(){ - _this.emit('socketError'); + socket.on('error', function(err){ + if (err.code === 'ECONNRESET') + _this.emit('socketDisconnect') + else + _this.emit('socketError'); }); } diff --git a/lib/vardiff.js b/lib/vardiff.js new file mode 100644 index 0000000..e69de29