mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
contractcourt: force the sweeper to always resolve outgoing HTLCs
In this commit, we attempt to fix an issue that may lead to force closes due to small value HTLCs. The sweeper has built in a "negative yield" heuristic where it won't sweep something that'll result in paying more fees than the HTLC amount. However for HTLCs, we want to always sweep them, as we don't cancel back the HTLCs before the outgoing contract is fully resolved. In the future, we'll start to make more uneconomical decisions about if we should go to chain at all for small value HTLCs, and also do things like cancel back early if the HTLC is small and we think we might be contested by chain fees.
This commit is contained in:
parent
bbbf7d33fb
commit
7686d10075
2 changed files with 5 additions and 3 deletions
|
@ -327,6 +327,7 @@ func (h *htlcTimeoutResolver) sweepSecondLevelTx() error {
|
|||
Fee: sweep.FeePreference{
|
||||
ConfTarget: secondLevelConfTarget,
|
||||
},
|
||||
Force: true,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
@ -781,9 +781,10 @@ func (u *UtxoNursery) sweepMatureOutputs(classHeight uint32,
|
|||
// passed in with disastrous consequences.
|
||||
local := output
|
||||
|
||||
resultChan, err := u.cfg.SweepInput(
|
||||
&local, sweep.Params{Fee: feePref},
|
||||
)
|
||||
resultChan, err := u.cfg.SweepInput(&local, sweep.Params{
|
||||
Fee: feePref,
|
||||
Force: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue