Fixed up error handling for stratum socket

This commit is contained in:
Matthew Little 2014-01-15 17:52:05 -07:00
parent e02b265d13
commit 8e3b28cea3
3 changed files with 6 additions and 3 deletions

View File

@ -154,8 +154,8 @@ var pool = module.exports = function pool(options, authorizeFn){
if (error)
emitErrorLog('system', 'Error with initial getblocktemplate');
else{
StartStratumServer();
SetupBlockPolling();
StartStratumServer();
}
});
});

View File

@ -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');
});
}

0
lib/vardiff.js Normal file
View File