mulit: remove ListLeasedOutputs in LeaseOutput

This commit removes the call toe `ListLeasedOutputs` in `LeaseOutput` -
the returned info from `ListLeasedOutputs` can easily be accessed via
`FetchInputInfo` and this info is only used at one callsite.
`ListLeasedOutputs` then becomes unnecessary here, plus it's very slow
and needs to be refactored in `btcwallet` instead.
This commit is contained in:
yyforyongyu committed 2024-08-09 22:01:57 +08:00
1 parent f70c919164
commit 3e36adf476
10 files changed
+17 -34

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ func lockInputs(w lnwallet.WalletController,
return nil, fmt.Errorf("fetch outpoint info: %w", err)
}
expiration, _, _, err := w.LeaseOutput(
expiration, err := w.LeaseOutput(
lock.LockID, lock.Outpoint,
chanfunding.DefaultLockDuration,
)
+1 -1
View File
@@ -490,7 +490,7 @@ func (w *WalletKit) LeaseOutput(ctx context.Context,
// other concurrent processes attempting to lease the same UTXO.
var expiration time.Time
err = w.cfg.CoinSelectionLocker.WithCoinSelectLock(func() error {
expiration, _, _, err = w.cfg.Wallet.LeaseOutput(
expiration, err = w.cfg.Wallet.LeaseOutput(
lockID, *op, duration,
)
return err