lnwallet: add derivation and prev TX to UTXO

This commit is contained in:
Oliver Gugger
2022-01-05 11:04:20 +01:00
parent 167a1f2b79
commit b54279dd87
2 changed files with 7 additions and 1 deletions

View File

@@ -24,7 +24,9 @@ import (
// //
// This is a part of the WalletController interface. // This is a part of the WalletController interface.
func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, error) { 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 { if err != nil {
return nil, err return nil, err
} }
@@ -44,6 +46,8 @@ func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, erro
PkScript: txOut.PkScript, PkScript: txOut.PkScript,
Confirmations: confirmations, Confirmations: confirmations,
OutPoint: *prevOut, OutPoint: *prevOut,
Derivation: bip32,
PrevTx: prevTx,
}, nil }, nil
} }

View File

@@ -78,6 +78,8 @@ type Utxo struct {
Confirmations int64 Confirmations int64
PkScript []byte PkScript []byte
wire.OutPoint wire.OutPoint
Derivation *psbt.Bip32Derivation
PrevTx *wire.MsgTx
} }
// TransactionDetail describes a transaction with either inputs which belong to // TransactionDetail describes a transaction with either inputs which belong to