htlcswitch/link: don't mark channel borked on force close scanarios
Instead of marking the channel Borked in cases where we want to force close it, we immediately let the peer fail the link. The channel state will instead be updated by the channel arbitrator, which will transition to StateBroadcastCommit, marking the channel borked, then marking the commitment tx broadcasted right before publishing the force close tx. We do this to avoid the case where we would mark it Borked, but go down before being able to publish the closing tx. Storing the force close tx ensures it will be re-published on startup.
This commit is contained in:
parent
6e361d04cf
commit
9423fadf56
@ -922,12 +922,12 @@ func (l *channelLink) htlcManager() {
|
||||
// what they sent us before.
|
||||
// TODO(halseth): ban peer?
|
||||
case err == lnwallet.ErrInvalidLocalUnrevokedCommitPoint:
|
||||
err = l.channel.MarkBorked()
|
||||
if err != nil {
|
||||
log.Errorf("Unable to mark channel "+
|
||||
"borked: %v", err)
|
||||
}
|
||||
|
||||
// We'll fail the link and tell the peer to
|
||||
// force close the channel. Note that the
|
||||
// database state is not updated here, but will
|
||||
// be updated when the close transaction is
|
||||
// ready to avoid that we go down before
|
||||
// storing the transaction in the db.
|
||||
l.fail(
|
||||
LinkFailureError{
|
||||
code: ErrSyncError,
|
||||
|
Loading…
Reference in New Issue
Block a user