diff --git a/lntest/mock/walletcontroller.go b/lntest/mock/walletcontroller.go index 3eddde3af2..cb7e387010 100644 --- a/lntest/mock/walletcontroller.go +++ b/lntest/mock/walletcontroller.go @@ -43,21 +43,6 @@ func (w *WalletController) BackEnd() string { return "mock" } -// FetchInputInfo will be called to get info about the inputs to the funding -// transaction. -func (w *WalletController) FetchInputInfo( - prevOut *wire.OutPoint) (*lnwallet.Utxo, error) { - - utxo := &lnwallet.Utxo{ - AddressType: lnwallet.WitnessPubKey, - Value: 10 * btcutil.SatoshiPerBitcoin, - PkScript: []byte("dummy"), - Confirmations: 1, - OutPoint: *prevOut, - } - return utxo, nil -} - // FetchOutpointInfo will be called to get info about the inputs to the funding // transaction. func (w *WalletController) FetchOutpointInfo( diff --git a/lnwallet/btcwallet/signer.go b/lnwallet/btcwallet/signer.go index e6021f12ad..97832a7890 100644 --- a/lnwallet/btcwallet/signer.go +++ b/lnwallet/btcwallet/signer.go @@ -19,44 +19,6 @@ import ( "github.com/lightningnetwork/lnd/lnwallet" ) -// FetchInputInfo queries for the WalletController's knowledge of the passed -// outpoint. If the base wallet determines this output is under its control, -// then the original txout should be returned. Otherwise, a non-nil error value -// of ErrNotMine should be returned instead. -// -// This is a part of the WalletController interface. -func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, - error) { - - prevTx, txOut, bip32, confirmations, err := b.wallet.FetchInputInfo( - prevOut, - ) - if err != nil { - return nil, err - } - - // Then, we'll populate all of the information required by the struct. - addressType := lnwallet.UnknownAddressType - switch { - case txscript.IsPayToWitnessPubKeyHash(txOut.PkScript): - addressType = lnwallet.WitnessPubKey - case txscript.IsPayToScriptHash(txOut.PkScript): - addressType = lnwallet.NestedWitnessPubKey - case txscript.IsPayToTaproot(txOut.PkScript): - addressType = lnwallet.TaprootPubkey - } - - return &lnwallet.Utxo{ - AddressType: addressType, - Value: btcutil.Amount(txOut.Value), - PkScript: txOut.PkScript, - Confirmations: confirmations, - OutPoint: *prevOut, - Derivation: bip32, - PrevTx: prevTx, - }, nil -} - // FetchOutpointInfo queries for the WalletController's knowledge of the passed // outpoint. If the base wallet determines this output is under its control, // then the original txout should be returned. Otherwise, a non-nil error value diff --git a/lnwallet/interface.go b/lnwallet/interface.go index c2aed8d89e..d3b123509b 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -126,8 +126,7 @@ type Utxo struct { Confirmations int64 PkScript []byte wire.OutPoint - Derivation *psbt.Bip32Derivation - PrevTx *wire.MsgTx + PrevTx *wire.MsgTx } // OutputDetail contains additional information on a destination address. @@ -227,11 +226,6 @@ type TransactionSubscription interface { // behavior of all interface methods in order to ensure identical behavior // across all concrete implementations. type WalletController interface { - // FetchInputInfo queries for the WalletController's knowledge of the - // passed outpoint. It returns the same info as `FetchOutpointInfo` - // plus the Bip32Derivation info. - FetchInputInfo(prevOut *wire.OutPoint) (*Utxo, error) - // FetchOutpointInfo queries for the WalletController's knowledge of // the passed outpoint. If the base wallet determines this output is // under its control, then the original txout should be returned. diff --git a/lnwallet/mock.go b/lnwallet/mock.go index e2c80580ed..faac5fa678 100644 --- a/lnwallet/mock.go +++ b/lnwallet/mock.go @@ -45,22 +45,6 @@ func (w *mockWalletController) BackEnd() string { return "mock" } -// FetchInputInfo will be called to get info about the inputs to the funding -// transaction. -func (w *mockWalletController) FetchInputInfo( - prevOut *wire.OutPoint) (*Utxo, error) { - - utxo := &Utxo{ - AddressType: WitnessPubKey, - Value: 10 * btcutil.SatoshiPerBitcoin, - PkScript: []byte("dummy"), - Confirmations: 1, - OutPoint: *prevOut, - } - - return utxo, nil -} - // FetchOutpointInfo will be called to get info about the inputs to the funding // transaction. func (w *mockWalletController) FetchOutpointInfo(