update submitted ntime!

This commit is contained in:
Ben Wilson
2023-06-30 09:06:39 -04:00
parent ea726bbba4
commit 385f5c56ef
2 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -76,7 +76,7 @@ export class MiningJob {
}
public copyAndUpdateBlock(versionMaskString: number, nonce: number, extraNonce: string, extraNonce2: string): bitcoinjs.Block {
public copyAndUpdateBlock(versionMaskString: number, nonce: number, extraNonce: string, extraNonce2: string, timestamp: number): bitcoinjs.Block {
const testBlock = bitcoinjs.Block.fromBuffer(this.block.toBuffer());
@@ -93,7 +93,9 @@ export class MiningJob {
//@ts-ignore
//recompute the root
testBlock.merkleRoot = this.calculateMerkleRootHash(testBlock.transactions[0].__toBuffer(), this.merkle_branch);;
testBlock.merkleRoot = this.calculateMerkleRootHash(testBlock.transactions[0].__toBuffer(), this.merkle_branch);
testBlock.timestamp = timestamp
return testBlock;
}