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