Skip to content

Commit

Permalink
Improve p2wpkh behavior when inputSighash is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Nov 23, 2024
1 parent 973d385 commit 0fabe06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ export class Transaction {
// We will lose some vectors -> smaller test coverage of preimages (very important!)
private inputSighash(idx: number) {
this.checkInputIdx(idx);
const sighash = getInputType(this.inputs[idx], this.opts.allowLegacyWitnessUtxo).sighash;
const inputSighash = this.inputs[idx].sighashType;
const sighash = inputSighash === undefined ? SignatureHash.DEFAULT : inputSighash;
// ALL or DEFAULT -- everything signed
// NONE -- all inputs + no outputs
// SINGLE -- all inputs + output with same index
Expand Down

0 comments on commit 0fabe06

Please sign in to comment.