mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
rpcwallet: don't re-use sign desc in loop
This commit fixes an issue with signing for mixed inputs in a remote signing setup where the re-use of the sign descriptor would lead to the sign method not being reset correctly if a p2wkh input is following a p2tr input.
This commit is contained in:
@@ -139,12 +139,15 @@ func (r *RPCKeyRing) SendOutputs(outputs []*wire.TxOut,
|
||||
// We know at this point that we only have inputs from our own wallet.
|
||||
// So we can just compute the input script using the remote signer.
|
||||
outputFetcher := lnwallet.NewWalletPrevOutputFetcher(r.WalletController)
|
||||
signDesc := input.SignDescriptor{
|
||||
HashType: txscript.SigHashAll,
|
||||
SigHashes: txscript.NewTxSigHashes(tx, outputFetcher),
|
||||
PrevOutputFetcher: outputFetcher,
|
||||
}
|
||||
for i, txIn := range tx.TxIn {
|
||||
signDesc := input.SignDescriptor{
|
||||
HashType: txscript.SigHashAll,
|
||||
SigHashes: txscript.NewTxSigHashes(
|
||||
tx, outputFetcher,
|
||||
),
|
||||
PrevOutputFetcher: outputFetcher,
|
||||
}
|
||||
|
||||
// We can only sign this input if it's ours, so we'll ask the
|
||||
// watch-only wallet if it can map this outpoint into a coin we
|
||||
// own. If not, then we can't continue because our wallet state
|
||||
|
Reference in New Issue
Block a user