This commit is contained in:
Ben Wilson
2023-07-16 18:48:53 -04:00
parent bb133a7af4
commit 6a6b2c32bf
4 changed files with 10 additions and 15 deletions
+3 -3
View File
@@ -356,18 +356,18 @@ export class StratumV1Client extends EasyUnsubscribe {
if (submissionDifficulty >= this.sessionDifficulty) {
if (submissionDifficulty >= job.networkDifficulty) {
if (submissionDifficulty >= jobTemplate.blockData.networkDifficulty) {
console.log('!!! BLOCK FOUND !!!');
const blockHex = updatedJobBlock.toHex(false);
const result = await this.bitcoinRpcService.SUBMIT_BLOCK(blockHex);
await this.blocksService.save({
height: jobTemplate.height,
height: jobTemplate.blockData.height,
minerAddress: this.clientAuthorization.address,
worker: this.clientAuthorization.worker,
sessionId: this.extraNonceAndSessionId,
blockData: blockHex
});
await this.notificationService.notifySubscribersBlockFound(this.clientAuthorization.address, jobTemplate.height, updatedJobBlock, result);
await this.notificationService.notifySubscribersBlockFound(this.clientAuthorization.address, jobTemplate.blockData.height, updatedJobBlock, result);
}
try {
await this.statistics.addSubmission(this.entity, submissionHash, this.sessionDifficulty);