From 47cf33be2710ad11de8f1babad578d298707fed2 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 3 Jul 2023 18:55:24 -0400 Subject: [PATCH] remove overall script length from coinbase input --- src/models/MiningJob.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/MiningJob.ts b/src/models/MiningJob.ts index d12d555..a7160db 100644 --- a/src/models/MiningJob.ts +++ b/src/models/MiningJob.ts @@ -55,7 +55,7 @@ export class MiningJob { // 32-byte - Commitment hash: Double-SHA256(witness root hash|witness reserved value) const commitmentHash = this.sha256(this.sha256(this.block.witnessCommit)); // 39th byte onwards: Optional data with no consensus meaning - coinbaseTransaction.ins[0].script = bitcoinjs.script.compile([Buffer.concat([Buffer.from([littleEndianBlockHeight.byteLength]), littleEndianBlockHeight, Buffer.from('00000000' + '00000000', 'hex')])]); + coinbaseTransaction.ins[0].script = Buffer.concat([Buffer.from([littleEndianBlockHeight.byteLength]), littleEndianBlockHeight, Buffer.from('00000000' + '00000000', 'hex')]); coinbaseTransaction.addOutput(bitcoinjs.script.compile([bitcoinjs.opcodes.OP_RETURN, Buffer.concat([segwitMagicBits, commitmentHash])]), 0); // get the non-witness coinbase tx