mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
clear jobs on new block
This commit is contained in:
@@ -309,7 +309,7 @@ export class StratumV1Client extends EasyUnsubscribe {
|
|||||||
jobTemplate
|
jobTemplate
|
||||||
);
|
);
|
||||||
|
|
||||||
this.stratumV1JobsService.addJob(job, jobTemplate.blockData.clearJobs);
|
this.stratumV1JobsService.addJob(job);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export class StratumV1JobsService {
|
|||||||
tap((data) => {
|
tap((data) => {
|
||||||
if (data.blockData.clearJobs) {
|
if (data.blockData.clearJobs) {
|
||||||
this.blocks = {};
|
this.blocks = {};
|
||||||
|
this.jobs = [];
|
||||||
}
|
}
|
||||||
this.blocks[data.blockData.id] = data;
|
this.blocks[data.blockData.id] = data;
|
||||||
}),
|
}),
|
||||||
@@ -154,10 +155,7 @@ export class StratumV1JobsService {
|
|||||||
return this.blocks[jobTemplateId];
|
return this.blocks[jobTemplateId];
|
||||||
}
|
}
|
||||||
|
|
||||||
public addJob(job: MiningJob, clearJobs: boolean) {
|
public addJob(job: MiningJob) {
|
||||||
if (clearJobs) {
|
|
||||||
this.jobs = [];
|
|
||||||
}
|
|
||||||
this.jobs.push(job);
|
this.jobs.push(job);
|
||||||
this.latestJobId++;
|
this.latestJobId++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user