mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 19:41:21 +02:00
htlcswitch: add new LinkFailureAction enum
In this commit, we add a new LinkFailureAction enum to take over the old force close bool. Force closing isn't the only thing we might want to do when we decide to fail the link, so this is a prep refactoring for an upcoming change.
This commit is contained in:
@@ -3094,11 +3094,10 @@ func (p *Brontide) handleLinkFailure(failure linkFailureReport) {
|
||||
// being applied.
|
||||
p.WipeChannel(&failure.chanPoint)
|
||||
|
||||
// If the error encountered was severe enough, we'll now force close the
|
||||
// channel to prevent reading it to the switch in the future.
|
||||
if failure.linkErr.ForceClose {
|
||||
p.log.Warnf("Force closing link(%v)",
|
||||
failure.shortChanID)
|
||||
// If the error encountered was severe enough, we'll now force close
|
||||
// the channel to prevent reading it to the switch in the future.
|
||||
if failure.linkErr.FailureAction == htlcswitch.LinkFailureForceClose {
|
||||
p.log.Warnf("Force closing link(%v)", failure.shortChanID)
|
||||
|
||||
closeTx, err := p.cfg.ChainArb.ForceCloseContract(
|
||||
failure.chanPoint,
|
||||
|
Reference in New Issue
Block a user