Skip to content

Commit

Permalink
Ignore LND mutual close errors instead of force-closing (#2907)
Browse files Browse the repository at this point in the history
Older lnd nodes are unable to mutual close channels while HTLCs are
in-flight. This triggers unexpected force-closes which can be costly
for node operators. We ignore the errors coming from lnd that match
this case to avoid that.
  • Loading branch information
DerEwige authored Sep 16, 2024
1 parent 1ff5697 commit a710922
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ trait ErrorHandlers extends CommonHandlers {
// it's up to them to broadcast their commitment if they wish.
log.warning("ignoring remote 'internal error', probably coming from lnd")
stay() sending Warning(d.channelId, "ignoring your 'internal error' to avoid an unnecessary force-close")
} else if (e.toAscii == "link failed to shutdown") {
// When trying to close a channel with LND older than version 0.18.0,
// LND will send an 'link failed to shutdown' error if there are HTLCs on the channel.
// Ignoring this error will prevent a force-close.
// The channel closing is retried on every reconnect of the channel, until it succeeds.
log.warning("ignoring remote 'link failed to shutdown', probably coming from lnd")
stay() sending Warning(d.channelId, "ignoring your 'link failed to shutdown' to avoid an unnecessary force-close")
} else {
spendLocalCurrent(hasCommitments)
}
Expand Down

0 comments on commit a710922

Please sign in to comment.