mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
misc
This commit is contained in:
@@ -25,6 +25,7 @@ export class AppController {
|
|||||||
name: worker.clientAuthorization.worker,
|
name: worker.clientAuthorization.worker,
|
||||||
bestDifficulty: Math.floor(worker.statistics.bestDifficulty),
|
bestDifficulty: Math.floor(worker.statistics.bestDifficulty),
|
||||||
hashRate: Math.floor(worker.statistics.getHashRate()),
|
hashRate: Math.floor(worker.statistics.getHashRate()),
|
||||||
|
startTime: worker.startTime
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -37,7 +38,8 @@ export class AppController {
|
|||||||
id: worker.id,
|
id: worker.id,
|
||||||
name: worker.clientAuthorization.worker,
|
name: worker.clientAuthorization.worker,
|
||||||
bestDifficulty: Math.floor(worker.statistics.bestDifficulty),
|
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.writeBigUint64LE(BigInt(job.nbits), 72);
|
||||||
header.writeUInt32LE(nonce, 76);
|
header.writeUInt32LE(nonce, 76);
|
||||||
|
|
||||||
console.log(header.toString('hex'))
|
|
||||||
|
|
||||||
|
|
||||||
const hashBuffer: Buffer = crypto.createHash('sha256').update(header).digest();
|
const hashBuffer: Buffer = crypto.createHash('sha256').update(header).digest();
|
||||||
const hashResult: Buffer = crypto.createHash('sha256').update(hashBuffer).digest();
|
const hashResult: Buffer = crypto.createHash('sha256').update(hashBuffer).digest();
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ export class SubscriptionMessage extends StratumBaseMessage {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.method = eRequestMethod.SUBSCRIBE;
|
this.method = eRequestMethod.SUBSCRIBE;
|
||||||
|
|
||||||
console.log('constructor SubscriptionMessage');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public response(clientId: string) {
|
public response(clientId: string) {
|
||||||
|
|||||||
@@ -42,10 +42,8 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('error', (error: Error) => {
|
socket.on('error', (error: Error) => {
|
||||||
// Handle socket error
|
// Handle socket error, usually a reset?
|
||||||
console.error(`Socket error:`, error);
|
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, () => {
|
}).listen(3333, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user