mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
don't attempt to destroy socket on end event
This commit is contained in:
@@ -309,7 +309,6 @@ export class StratumV1Client {
|
|||||||
).subscribe(async (jobTemplate) => {
|
).subscribe(async (jobTemplate) => {
|
||||||
try {
|
try {
|
||||||
await this.sendNewMiningJob(jobTemplate);
|
await this.sendNewMiningJob(jobTemplate);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.promiseSocket.socket.emit('end', true);
|
this.promiseSocket.socket.emit('end', true);
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -345,8 +344,6 @@ export class StratumV1Client {
|
|||||||
let payoutInformation;
|
let payoutInformation;
|
||||||
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
|
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
|
||||||
//50Th/s
|
//50Th/s
|
||||||
console.log('HASH RATE');
|
|
||||||
console.log(hashRate);
|
|
||||||
const noFee = hashRate != 0 && hashRate < 50000000000000;
|
const noFee = hashRate != 0 && hashRate < 50000000000000;
|
||||||
if (noFee || devFeeAddress == null || devFeeAddress.length < 1) {
|
if (noFee || devFeeAddress == null || devFeeAddress.length < 1) {
|
||||||
payoutInformation = [
|
payoutInformation = [
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private startSocketServer() {
|
private startSocketServer() {
|
||||||
const server = new Server(async (s: Socket) => {
|
const server = new Server(async (socket: Socket) => {
|
||||||
|
|
||||||
const promiseSocket = new PromiseSocket(s);
|
const promiseSocket = new PromiseSocket(socket);
|
||||||
|
|
||||||
const client = new StratumV1Client(
|
const client = new StratumV1Client(
|
||||||
promiseSocket,
|
promiseSocket,
|
||||||
@@ -67,7 +67,6 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
const clientCount = await this.clientService.connectedClientCount();
|
const clientCount = await this.clientService.connectedClientCount();
|
||||||
|
|
||||||
console.log(`Client disconnected, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
console.log(`Client disconnected, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
||||||
promiseSocket.destroy();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -81,7 +80,6 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
console.log(`Client disconnected, socket error, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
||||||
|
|
||||||
promiseSocket.destroy();
|
promiseSocket.destroy();
|
||||||
//console.error(error);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user