diff --git a/contractcourt/htlc_timeout_resolver.go b/contractcourt/htlc_timeout_resolver.go index e7ab421691..0dd1a91f1d 100644 --- a/contractcourt/htlc_timeout_resolver.go +++ b/contractcourt/htlc_timeout_resolver.go @@ -501,15 +501,9 @@ func (h *htlcTimeoutResolver) sweepSecondLevelTx(immediate bool) error { } // Calculate the budget. - // - // TODO(yy): the budget is twice the output's value, which is needed as - // we don't force sweep the output now. To prevent cascading force - // closes, we use all its output value plus a wallet input as the - // budget. This is a temporary solution until we can optionally cancel - // the incoming HTLC, more details in, - // - https://github.com/lightningnetwork/lnd/issues/7969 budget := calculateBudget( - btcutil.Amount(inp.SignDesc().Output.Value), 2, 0, + btcutil.Amount(inp.SignDesc().Output.Value), + h.Budget.DeadlineHTLCRatio, h.Budget.DeadlineHTLC, ) // For an outgoing HTLC, it must be swept before the RefundTimeout of @@ -588,15 +582,9 @@ func (h *htlcTimeoutResolver) sweepDirectHtlcOutput(immediate bool) error { ) // Calculate the budget. - // - // TODO(yy): the budget is twice the output's value, which is needed as - // we don't force sweep the output now. To prevent cascading force - // closes, we use all its output value plus a wallet input as the - // budget. This is a temporary solution until we can optionally cancel - // the incoming HTLC, more details in, - // - https://github.com/lightningnetwork/lnd/issues/7969 budget := calculateBudget( - btcutil.Amount(sweepInput.SignDesc().Output.Value), 2, 0, + btcutil.Amount(sweepInput.SignDesc().Output.Value), + h.Budget.DeadlineHTLCRatio, h.Budget.DeadlineHTLC, ) log.Infof("%T(%x): offering offered remote timeout HTLC output to "+ diff --git a/docs/release-notes/release-notes-0.19.0.md b/docs/release-notes/release-notes-0.19.0.md index aef92daba9..d06bf17986 100644 --- a/docs/release-notes/release-notes-0.19.0.md +++ b/docs/release-notes/release-notes-0.19.0.md @@ -92,6 +92,9 @@ * LND updates channel.backup file at shutdown time. +* [Decrease the budget for ougtoing HTLCs and + make it configurable](https://github.com/lightningnetwork/lnd/pull/9274) + ## RPC Updates * Some RPCs that previously just returned an empty response message now at least