Fixed up error handling for stratum socket
This commit is contained in:
parent
e02b265d13
commit
8e3b28cea3
@ -154,8 +154,8 @@ var pool = module.exports = function pool(options, authorizeFn){
|
|||||||
if (error)
|
if (error)
|
||||||
emitErrorLog('system', 'Error with initial getblocktemplate');
|
emitErrorLog('system', 'Error with initial getblocktemplate');
|
||||||
else{
|
else{
|
||||||
StartStratumServer();
|
|
||||||
SetupBlockPolling();
|
SetupBlockPolling();
|
||||||
|
StartStratumServer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -178,8 +178,11 @@ var StratumClient = function(options){
|
|||||||
socket.on('end', function() {
|
socket.on('end', function() {
|
||||||
_this.emit('socketDisconnect')
|
_this.emit('socketDisconnect')
|
||||||
});
|
});
|
||||||
socket.on('error', function(){
|
socket.on('error', function(err){
|
||||||
_this.emit('socketError');
|
if (err.code === 'ECONNRESET')
|
||||||
|
_this.emit('socketDisconnect')
|
||||||
|
else
|
||||||
|
_this.emit('socketError');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
0
lib/vardiff.js
Normal file
0
lib/vardiff.js
Normal file
Loading…
Reference in New Issue
Block a user