From 5bd3e917507e91e17444061c8b5728256e969cf1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 10 Nov 2022 13:10:55 +0100 Subject: [PATCH] rpcwallet: pass prev output fetcher into ComputeInputScript This commit fixes signing of Taproot inputs when some of the other inputs of the transaction are not known to the wallet (such as a Pool account for example). If we want to sign for a Taproot (change) input when depositing into a Pool account the wallet won't know the Pool account input. So we need to make sure we pass it along inside the PrevOutputFetcher (which contains the UTXO information extracted from the PSBT). --- lnwallet/rpcwallet/rpcwallet.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnwallet/rpcwallet/rpcwallet.go b/lnwallet/rpcwallet/rpcwallet.go index 71d74e7e8..9172c2525 100644 --- a/lnwallet/rpcwallet/rpcwallet.go +++ b/lnwallet/rpcwallet/rpcwallet.go @@ -293,9 +293,10 @@ func (r *RPCKeyRing) FinalizePsbt(packet *psbt.Packet, _ string) error { Value: int64(utxo.Value), PkScript: utxo.PkScript, }, - HashType: in.SighashType, - SigHashes: sigHashes, - InputIndex: idx, + HashType: in.SighashType, + SigHashes: sigHashes, + InputIndex: idx, + PrevOutputFetcher: prevOutFetcher, } // Find out what UTXO we are signing. Wallets _should_ always