From b9357fe8303de2ba3f9aef6a92ececbc6ac7acc3 Mon Sep 17 00:00:00 2001 From: Alex Akselrod Date: Wed, 21 Feb 2024 15:31:54 -0800 Subject: [PATCH] multi: remove unused `LockOutpoint` and `UnlockOutpoint` --- lntest/mock/walletcontroller.go | 6 ------ lnwallet/btcwallet/btcwallet.go | 22 ---------------------- lnwallet/interface.go | 14 -------------- lnwallet/mock.go | 6 ------ 4 files changed, 48 deletions(-) diff --git a/lntest/mock/walletcontroller.go b/lntest/mock/walletcontroller.go index 6c0f3e6a9..6381b4bb3 100644 --- a/lntest/mock/walletcontroller.go +++ b/lntest/mock/walletcontroller.go @@ -186,12 +186,6 @@ func (w *WalletController) ListTransactionDetails(int32, int32, return nil, nil } -// LockOutpoint currently does nothing. -func (w *WalletController) LockOutpoint(o wire.OutPoint) {} - -// UnlockOutpoint currently does nothing. -func (w *WalletController) UnlockOutpoint(o wire.OutPoint) {} - // LeaseOutput returns the current time and a nil error. func (w *WalletController) LeaseOutput(wtxmgr.LockID, wire.OutPoint, time.Duration) (time.Time, []byte, btcutil.Amount, error) { diff --git a/lnwallet/btcwallet/btcwallet.go b/lnwallet/btcwallet/btcwallet.go index 364953be4..61d53787a 100644 --- a/lnwallet/btcwallet/btcwallet.go +++ b/lnwallet/btcwallet/btcwallet.go @@ -1052,28 +1052,6 @@ func (b *BtcWallet) CreateSimpleTx(outputs []*wire.TxOut, ) } -// LockOutpoint marks an outpoint as locked meaning it will no longer be deemed -// as eligible for coin selection. Locking outputs are utilized in order to -// avoid race conditions when selecting inputs for usage when funding a -// channel. -// -// NOTE: This method requires the global coin selection lock to be held. -// -// This is a part of the WalletController interface. -func (b *BtcWallet) LockOutpoint(o wire.OutPoint) { - b.wallet.LockOutpoint(o) -} - -// UnlockOutpoint unlocks a previously locked output, marking it eligible for -// coin selection. -// -// NOTE: This method requires the global coin selection lock to be held. -// -// This is a part of the WalletController interface. -func (b *BtcWallet) UnlockOutpoint(o wire.OutPoint) { - b.wallet.UnlockOutpoint(o) -} - // LeaseOutput locks an output to the given ID, preventing it from being // available for any future coin selection attempts. The absolute time of the // lock's expiration is returned. The expiration of the lock can be extended by diff --git a/lnwallet/interface.go b/lnwallet/interface.go index 3df0a7328..c3944d812 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -393,20 +393,6 @@ type WalletController interface { ListTransactionDetails(startHeight, endHeight int32, accountFilter string) ([]*TransactionDetail, error) - // LockOutpoint marks an outpoint as locked meaning it will no longer - // be deemed as eligible for coin selection. Locking outputs are - // utilized in order to avoid race conditions when selecting inputs for - // usage when funding a channel. - // - // NOTE: This method requires the global coin selection lock to be held. - LockOutpoint(o wire.OutPoint) - - // UnlockOutpoint unlocks a previously locked output, marking it - // eligible for coin selection. - // - // NOTE: This method requires the global coin selection lock to be held. - UnlockOutpoint(o wire.OutPoint) - // LeaseOutput locks an output to the given ID, preventing it from being // available for any future coin selection attempts. The absolute time // of the lock's expiration is returned. The expiration of the lock can diff --git a/lnwallet/mock.go b/lnwallet/mock.go index dc59c63ac..1c1fb61a5 100644 --- a/lnwallet/mock.go +++ b/lnwallet/mock.go @@ -192,12 +192,6 @@ func (w *mockWalletController) ListTransactionDetails(int32, int32, return nil, nil } -// LockOutpoint currently does nothing. -func (w *mockWalletController) LockOutpoint(o wire.OutPoint) {} - -// UnlockOutpoint currently does nothing. -func (w *mockWalletController) UnlockOutpoint(o wire.OutPoint) {} - // LeaseOutput returns the current time and a nil error. func (w *mockWalletController) LeaseOutput(wtxmgr.LockID, wire.OutPoint, time.Duration) (time.Time, []byte, btcutil.Amount, error) {