optimizations and cleanup

This commit is contained in:
Ben Wilson
2023-08-07 23:12:52 -04:00
parent 14f6d5802f
commit b1cfe07222
3 changed files with 15 additions and 15 deletions
+5 -10
View File
@@ -57,23 +57,18 @@ export class StratumV1Service implements OnModuleInit {
);
socket.on('end', async (error: Error) => {
socket.on('close', async (hadError: boolean) => {
if (client.extraNonceAndSessionId != null) {
// Handle socket disconnection
await client.destroy();
console.log(`Client disconnected, ${client.extraNonceAndSessionId}`);
console.log(`Client ${client.extraNonceAndSessionId} disconnected, hadError?:${hadError}`);
}
});
socket.on('error', async (error: Error) => {
if (client.extraNonceAndSessionId != null) {
await client.destroy();
console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
}
socket.on('error', async (error: Error) => { });
// //console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
socket.destroy();
});
});