From b54279dd8747746c654242014f8da3e82a0971a3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 5 Jan 2022 11:04:20 +0100 Subject: [PATCH] lnwallet: add derivation and prev TX to UTXO --- lnwallet/btcwallet/signer.go | 6 +++++- lnwallet/interface.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lnwallet/btcwallet/signer.go b/lnwallet/btcwallet/signer.go index bf339b519..8ecaf5cd8 100644 --- a/lnwallet/btcwallet/signer.go +++ b/lnwallet/btcwallet/signer.go @@ -24,7 +24,9 @@ import ( // // This is a part of the WalletController interface. func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, error) { - _, txOut, _, confirmations, err := b.wallet.FetchInputInfo(prevOut) + prevTx, txOut, bip32, confirmations, err := b.wallet.FetchInputInfo( + prevOut, + ) if err != nil { return nil, err } @@ -44,6 +46,8 @@ func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, erro PkScript: txOut.PkScript, Confirmations: confirmations, OutPoint: *prevOut, + Derivation: bip32, + PrevTx: prevTx, }, nil } diff --git a/lnwallet/interface.go b/lnwallet/interface.go index a8e14dfff..455d48b00 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -78,6 +78,8 @@ type Utxo struct { Confirmations int64 PkScript []byte wire.OutPoint + Derivation *psbt.Bip32Derivation + PrevTx *wire.MsgTx } // TransactionDetail describes a transaction with either inputs which belong to