null jobTemplate

This commit is contained in:
Benjamin Wilson
2024-07-10 22:40:02 -04:00
parent 2bfbc2d79a
commit 8905409880
+4 -2
View File
@@ -477,8 +477,10 @@ export class StratumV1Client {
const job = this.stratumV1JobsService.getJobById(submission.jobId); const job = this.stratumV1JobsService.getJobById(submission.jobId);
const jobTemplate = this.stratumV1JobsService.getJobTemplateById(job.jobTemplateId);
// a miner may submit a job that doesn't exist anymore if it was removed by a new block notification // a miner may submit a job that doesn't exist anymore if it was removed by a new block notification
if (job == null) { if (job == null || jobTemplate == null) {
const err = new StratumErrorMessage( const err = new StratumErrorMessage(
submission.id, submission.id,
eStratumErrorCode.JobNotFound, eStratumErrorCode.JobNotFound,
@@ -490,7 +492,7 @@ export class StratumV1Client {
} }
return false; return false;
} }
const jobTemplate = this.stratumV1JobsService.getJobTemplateById(job.jobTemplateId);
const updatedJobBlock = job.copyAndUpdateBlock( const updatedJobBlock = job.copyAndUpdateBlock(
jobTemplate, jobTemplate,