getSuggestedDifficulty bug

This commit is contained in:
Ben Wilson
2023-08-06 22:41:25 -04:00
parent 0a9c254e84
commit 1172ab5971
5 changed files with 38 additions and 36 deletions
+9 -17
View File
@@ -58,28 +58,20 @@ export class StratumV1Service implements OnModuleInit {
socket.on('end', async (error: Error) => {
// Handle socket disconnection
client.destroy();
await this.clientService.delete(client.extraNonceAndSessionId);
const clientCount = await this.clientService.connectedClientCount();
console.log(`Client disconnected, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
if (client.extraNonceAndSessionId != null) {
// Handle socket disconnection
await client.destroy();
console.log(`Client disconnected, ${client.extraNonceAndSessionId}`);
}
});
socket.on('error', async (error: Error) => {
client.destroy();
await this.clientService.delete(client.extraNonceAndSessionId);
const clientCount = await this.clientService.connectedClientCount();
console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
if (client.extraNonceAndSessionId != null) {
await client.destroy();
console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}`);
}
socket.destroy();
});
});