mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-27 02:02:10 +01:00
misc
This commit is contained in:
parent
b9a631c29c
commit
b963eaa514
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -12,8 +12,6 @@ export class SubscriptionMessage extends StratumBaseMessage {
|
||||
constructor() {
|
||||
super();
|
||||
this.method = eRequestMethod.SUBSCRIBE;
|
||||
|
||||
console.log('constructor SubscriptionMessage');
|
||||
}
|
||||
|
||||
public response(clientId: string) {
|
||||
|
@ -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, () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user