mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
bug
This commit is contained in:
@@ -29,6 +29,7 @@ export class StratumV1JobsService {
|
|||||||
public newMiningJob$: Observable<IJobTemplate>;
|
public newMiningJob$: Observable<IJobTemplate>;
|
||||||
|
|
||||||
public latestJobId: number = 1;
|
public latestJobId: number = 1;
|
||||||
|
public latestJobTemplateId: number = 1;
|
||||||
|
|
||||||
public jobs: MiningJob[] = [];
|
public jobs: MiningJob[] = [];
|
||||||
|
|
||||||
@@ -108,11 +109,13 @@ export class StratumV1JobsService {
|
|||||||
block.transactions = transactions;
|
block.transactions = transactions;
|
||||||
block.witnessCommit = bitcoinjs.Block.calculateMerkleRoot(transactions, true);
|
block.witnessCommit = bitcoinjs.Block.calculateMerkleRoot(transactions, true);
|
||||||
|
|
||||||
|
const id = this.getNextTemplateId();
|
||||||
|
this.latestJobTemplateId++;
|
||||||
return {
|
return {
|
||||||
block,
|
block,
|
||||||
merkle_branch,
|
merkle_branch,
|
||||||
blockData: {
|
blockData: {
|
||||||
id: this.getNextId(),
|
id,
|
||||||
littleEndianBlockHeight,
|
littleEndianBlockHeight,
|
||||||
coinbasevalue,
|
coinbasevalue,
|
||||||
networkDifficulty,
|
networkDifficulty,
|
||||||
@@ -167,6 +170,9 @@ export class StratumV1JobsService {
|
|||||||
return this.jobs.find(job => job.jobId == jobId);
|
return this.jobs.find(job => job.jobId == jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getNextTemplateId() {
|
||||||
|
return this.latestJobTemplateId.toString(16);
|
||||||
|
}
|
||||||
public getNextId() {
|
public getNextId() {
|
||||||
return this.latestJobId.toString(16);
|
return this.latestJobId.toString(16);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user