improvements

This commit is contained in:
Ben Wilson
2023-06-29 11:59:17 -04:00
parent 8878b31377
commit cef9114c83
4 changed files with 32 additions and 20 deletions
+2 -1
View File
@@ -47,6 +47,7 @@ export class StratumV1Service implements OnModuleInit {
socket.on('end', async () => {
// Handle socket disconnection
client.destroy();
await this.clientService.delete(client.extraNonce);
const clientCount = await this.clientService.connectedClientCount();
@@ -55,8 +56,8 @@ export class StratumV1Service implements OnModuleInit {
socket.on('error', async (error: Error) => {
client.destroy();
await this.clientService.delete(client.extraNonce);
const clientCount = await this.clientService.connectedClientCount();
console.error(`Socket error:`, error);
console.log(`Client disconnected: ${socket.remoteAddress}, ${clientCount} total clients`);