lnwallet: don't re-use sign descriptor

Fixes an issue where re-using a sign descriptor in a loop carried over
signing information from one call to the next, which caused the remote
signing issue.
This commit is contained in:
Oliver Gugger 2023-02-07 22:15:10 +01:00
parent e4f3a35c0c
commit a2a96c7712
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -110,13 +110,12 @@ func (f *FullIntent) CompileFundingTx(extraInputs []*wire.TxIn,
prevOutFetcher := NewSegWitV0DualFundingPrevOutputFetcher(
f.coinSource, extraInputs,
)
signDesc := input.SignDescriptor{
SigHashes: txscript.NewTxSigHashes(
fundingTx, prevOutFetcher,
),
PrevOutputFetcher: prevOutFetcher,
}
sigHashes := txscript.NewTxSigHashes(fundingTx, prevOutFetcher)
for i, txIn := range fundingTx.TxIn {
signDesc := input.SignDescriptor{
SigHashes: sigHashes,
PrevOutputFetcher: prevOutFetcher,
}
// We can only sign this input if it's ours, so we'll ask the
// coin source if it can map this outpoint into a coin we own.
// If not, then we'll continue as it isn't our input.