multi: use prev output fetcher in sign desc

pull/70/head
Oliver Gugger 1 year ago
parent bd794843b3
commit 2e9a0f8dbe
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -223,10 +223,11 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
}) })
signDescs = append(signDescs, &input.SignDescriptor{ signDescs = append(signDescs, &input.SignDescriptor{
KeyDesc: *target.keyDesc, KeyDesc: *target.keyDesc,
WitnessScript: target.script, WitnessScript: target.script,
Output: prevTxOut, Output: prevTxOut,
HashType: txscript.SigHashAll, HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
}) })
} }
} }

@ -271,9 +271,10 @@ func sweepTimeLock(extendedKey *hdkeychain.ExtendedKey, apiURL string,
target.commitPoint, target.commitPoint,
target.delayBasePointDesc.PubKey, target.delayBasePointDesc.PubKey,
), ),
WitnessScript: script, WitnessScript: script,
Output: prevTxOut, Output: prevTxOut,
HashType: txscript.SigHashAll, HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
} }
totalOutputValue += target.value totalOutputValue += target.value
signDescs = append(signDescs, signDesc) signDescs = append(signDescs, signDesc)

@ -271,9 +271,10 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
PkScript: scriptHash, PkScript: scriptHash,
Value: sweepValue, Value: sweepValue,
}, },
InputIndex: 0, InputIndex: 0,
SigHashes: sigHashes, SigHashes: sigHashes,
HashType: txscript.SigHashAll, PrevOutputFetcher: prevOutFetcher,
HashType: txscript.SigHashAll,
} }
witness, err := input.CommitSpendTimeout(signer, signDesc, sweepTx) witness, err := input.CommitSpendTimeout(signer, signDesc, sweepTx)
if err != nil { if err != nil {

@ -135,11 +135,12 @@ func (s *Signer) AddPartialSignature(packet *psbt.Packet,
// Now we add our partial signature. // Now we add our partial signature.
prevOutFetcher := wallet.PsbtPrevOutputFetcher(packet) prevOutFetcher := wallet.PsbtPrevOutputFetcher(packet)
signDesc := &input.SignDescriptor{ signDesc := &input.SignDescriptor{
KeyDesc: keyDesc, KeyDesc: keyDesc,
WitnessScript: witnessScript, WitnessScript: witnessScript,
Output: utxo, Output: utxo,
InputIndex: inputIndex, InputIndex: inputIndex,
HashType: txscript.SigHashAll, HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
SigHashes: txscript.NewTxSigHashes( SigHashes: txscript.NewTxSigHashes(
packet.UnsignedTx, prevOutFetcher, packet.UnsignedTx, prevOutFetcher,
), ),

Loading…
Cancel
Save