@btc-vision/transaction 1.6.7 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- export declare const version = "1.6.7";
1
+ export declare const version = "1.6.8";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.6.7';
1
+ export const version = '1.6.8';
@@ -240,11 +240,23 @@ export class TransactionBuilder extends TweakedTransaction {
240
240
  ]),
241
241
  };
242
242
  }
243
- if (!input.witnessUtxo && input.nonWitnessUtxo) {
244
- return {
245
- finalScriptSig: bitcoin.script.compile([dummyEcdsaSig, dummyCompressedPubkey]),
246
- finalScriptWitness: undefined,
247
- };
243
+ if (input.witnessUtxo) {
244
+ const script = input.witnessUtxo.script;
245
+ const decompiled = bitcoin.script.decompile(script);
246
+ if (decompiled &&
247
+ decompiled.length === 5 &&
248
+ decompiled[0] === opcodes.OP_DUP &&
249
+ decompiled[1] === opcodes.OP_HASH160 &&
250
+ decompiled[3] === opcodes.OP_EQUALVERIFY &&
251
+ decompiled[4] === opcodes.OP_CHECKSIG) {
252
+ return {
253
+ finalScriptSig: bitcoin.script.compile([
254
+ dummyEcdsaSig,
255
+ dummyCompressedPubkey,
256
+ ]),
257
+ finalScriptWitness: undefined,
258
+ };
259
+ }
248
260
  }
249
261
  if (input.witnessScript) {
250
262
  if (this.csvInputIndices.has(inputIndex)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/transaction",
3
3
  "type": "module",
4
- "version": "1.6.7",
4
+ "version": "1.6.8",
5
5
  "author": "BlobMaster41",
6
6
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
7
7
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.6.7';
1
+ export const version = '1.6.8';
@@ -523,11 +523,25 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
523
523
  };
524
524
  }
525
525
 
526
- if (!input.witnessUtxo && input.nonWitnessUtxo) {
527
- return {
528
- finalScriptSig: bitcoin.script.compile([dummyEcdsaSig, dummyCompressedPubkey]),
529
- finalScriptWitness: undefined,
530
- };
526
+ if (input.witnessUtxo) {
527
+ const script = input.witnessUtxo.script;
528
+ const decompiled = bitcoin.script.decompile(script);
529
+ if (
530
+ decompiled &&
531
+ decompiled.length === 5 &&
532
+ decompiled[0] === opcodes.OP_DUP &&
533
+ decompiled[1] === opcodes.OP_HASH160 &&
534
+ decompiled[3] === opcodes.OP_EQUALVERIFY &&
535
+ decompiled[4] === opcodes.OP_CHECKSIG
536
+ ) {
537
+ return {
538
+ finalScriptSig: bitcoin.script.compile([
539
+ dummyEcdsaSig,
540
+ dummyCompressedPubkey,
541
+ ]),
542
+ finalScriptWitness: undefined,
543
+ };
544
+ }
531
545
  }
532
546
 
533
547
  if (input.witnessScript) {