cleanup and support for all address types

This commit is contained in:
Ben Wilson
2023-06-26 20:52:00 -04:00
parent 5ec2906f99
commit a435a9bbd8
15 changed files with 253 additions and 31 deletions
+32
View File
@@ -0,0 +1,32 @@
import { MiningJob } from '../models/MiningJob';
export class StratumV1JobsService {
public latestJobId: number = 1;
public jobs: MiningJob[] = [];
public addJob(job: MiningJob, clearJobs: boolean) {
if (clearJobs) {
this.jobs = [];
}
this.jobs.push(job);
this.latestJobId++;
}
public getLatestJob() {
return this.jobs[this.jobs.length - 1];
}
public getJobById(jobId: string) {
return this.jobs.find(job => job.jobId == jobId);
}
public getNextId() {
return this.latestJobId.toString(16);
}
}