|
|
@ -232,6 +232,11 @@ function prepareInput (input, ourPubKey, redeemScript, witnessValue, witnessScri |
|
|
|
expanded.signatures = input.signatures |
|
|
|
} |
|
|
|
|
|
|
|
let signScript = witnessScript |
|
|
|
if (expanded.type === SCRIPT_TYPES.P2WPKH) { |
|
|
|
signScript = payments.p2pkh({ pubkey: expanded.pubkeys[0] }).output |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
redeemScript, |
|
|
|
redeemScriptType: SCRIPT_TYPES.P2WSH, |
|
|
@ -243,7 +248,7 @@ function prepareInput (input, ourPubKey, redeemScript, witnessValue, witnessScri |
|
|
|
prevOutScript: p2sh.output, |
|
|
|
|
|
|
|
hasWitness: true, |
|
|
|
signScript: witnessScript, |
|
|
|
signScript, |
|
|
|
signType: expanded.type, |
|
|
|
|
|
|
|
pubkeys: expanded.pubkeys, |
|
|
@ -303,6 +308,11 @@ function prepareInput (input, ourPubKey, redeemScript, witnessValue, witnessScri |
|
|
|
expanded.signatures = input.signatures |
|
|
|
} |
|
|
|
|
|
|
|
let signScript = witnessScript |
|
|
|
if (expanded.type === SCRIPT_TYPES.P2WPKH) { |
|
|
|
signScript = payments.p2pkh({ pubkey: expanded.pubkeys[0] }).output |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
witnessScript, |
|
|
|
witnessScriptType: expanded.type, |
|
|
@ -311,7 +321,7 @@ function prepareInput (input, ourPubKey, redeemScript, witnessValue, witnessScri |
|
|
|
prevOutScript: p2wsh.output, |
|
|
|
|
|
|
|
hasWitness: true, |
|
|
|
signScript: witnessScript, |
|
|
|
signScript, |
|
|
|
signType: expanded.type, |
|
|
|
|
|
|
|
pubkeys: expanded.pubkeys, |
|
|
|