testNonceValue work

This commit is contained in:
Ben Wilson
2023-06-11 14:30:30 -04:00
parent e8a5e263b0
commit edd2845829
2 changed files with 30 additions and 22 deletions
+4 -2
View File
@@ -15,7 +15,7 @@ export class MiningJob {
public params: string[];
public target: string;
public merkleRoot: Buffer;
public merkleRoot: string;
public job_id: string; // ID of the job. Use this ID while submitting share generated from this job.
public prevhash: string; // The hex-encoded previous block hash.
@@ -31,6 +31,8 @@ export class MiningJob {
constructor(blockTemplate: IBlockTemplate) {
console.log(blockTemplate);
this.job_id = randomUUID();
this.target = blockTemplate.target;
this.prevhash = blockTemplate.previousblockhash;
@@ -71,7 +73,7 @@ export class MiningJob {
this.merkle_branch = branch;
this.merkleRoot = tree.getRoot();
this.merkleRoot = tree.getRoot().toString('hex')
}