This commit is contained in:
Ben Wilson 2023-06-23 16:32:33 -04:00
parent b9a631c29c
commit b963eaa514
4 changed files with 4 additions and 9 deletions

View File

@ -25,6 +25,7 @@ export class AppController {
name: worker.clientAuthorization.worker,
bestDifficulty: Math.floor(worker.statistics.bestDifficulty),
hashRate: Math.floor(worker.statistics.getHashRate()),
startTime: worker.startTime
}
})
}
@ -37,7 +38,8 @@ export class AppController {
id: worker.id,
name: worker.clientAuthorization.worker,
bestDifficulty: Math.floor(worker.statistics.bestDifficulty),
hashData: worker.statistics.historicSubmissions
hashData: worker.statistics.historicSubmissions,
startTime: worker.startTime
}
}
}

View File

@ -95,9 +95,6 @@ export class MiningSubmitMessage extends StratumBaseMessage {
header.writeBigUint64LE(BigInt(job.nbits), 72);
header.writeUInt32LE(nonce, 76);
console.log(header.toString('hex'))
const hashBuffer: Buffer = crypto.createHash('sha256').update(header).digest();
const hashResult: Buffer = crypto.createHash('sha256').update(hashBuffer).digest();

View File

@ -12,8 +12,6 @@ export class SubscriptionMessage extends StratumBaseMessage {
constructor() {
super();
this.method = eRequestMethod.SUBSCRIBE;
console.log('constructor SubscriptionMessage');
}
public response(clientId: string) {

View File

@ -42,10 +42,8 @@ export class StratumV1Service implements OnModuleInit {
});
socket.on('error', (error: Error) => {
// Handle socket error
// Handle socket error, usually a reset?
console.error(`Socket error:`, error);
this.clients = this.clients.filter(c => c.id == client.id);
console.log(`Client disconnected: ${socket.remoteAddress}, ${this.clients.length} total clients`);
});
}).listen(3333, () => {