mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
rpcwallet: attempt to locate UTXO information in prev output fetcher
Since we might now be given a whole list of UTXOs in the PrevOutputs field of the SignOutputRaw RPC, the previous output fetcher might contain the information we require for the remote signing case. So instead of failing if our wallet doesn't know each input that's being spent, we fall back to the UTXO information contained in the previous outputs.
This commit is contained in:
parent
0051e39078
commit
5395a0fe6b
1 changed files with 13 additions and 0 deletions
|
@ -803,6 +803,19 @@ func (r *RPCKeyRing) remoteSign(tx *wire.MsgTx, signDesc *input.SignDescriptor,
|
|||
&txIn.PreviousOutPoint,
|
||||
)
|
||||
if err != nil {
|
||||
// Maybe we have an UTXO in the previous output fetcher?
|
||||
if signDesc.PrevOutputFetcher != nil {
|
||||
utxo := signDesc.PrevOutputFetcher.FetchPrevOutput(
|
||||
txIn.PreviousOutPoint,
|
||||
)
|
||||
if utxo != nil && utxo.Value != 0 &&
|
||||
len(utxo.PkScript) > 0 {
|
||||
|
||||
packet.Inputs[idx].WitnessUtxo = utxo
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
log.Warnf("No UTXO info found for index %d "+
|
||||
"(prev_outpoint=%v), won't be able to sign "+
|
||||
"for taproot output!", idx,
|
||||
|
|
Loading…
Add table
Reference in a new issue