Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease outgoing htlc budget #9274

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions contractcourt/htlc_timeout_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "+
Expand Down
3 changes: 3 additions & 0 deletions docs/release-notes/release-notes-0.19.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading