htlcswitch: add new LinkFailureDisconnect action
In this commit, we add a new LinkFailureDisconnect action that'll be
used if we detect that the remote party hasn't sent a revoke and ack
when it actually should.
Before this commit, we would log our action, tear down the link, but
then not actually force a connection recycle, as we assumed that if the
TCP connection was actually stale, then the read/write timeout would
expire.
In practice this doesn't always seem to be the case, so we make a strong
action here to actually force a disconnection in hopes that either side
will reconnect and keep the good times rollin' 🕺.
This commit is contained in:
5 files changed
+40
-12
No files matched your search
+8
-3
@@ -1037,7 +1037,7 @@ func (l *channelLink) htlcManager() {
|
||||
l.fail(
|
||||
LinkFailureError{
|
||||
code: ErrSyncError,
|
||||
FailureAction: LinkFailureForceClose, // nolint:lll
|
||||
FailureAction: LinkFailureForceClose, //nolint:lll
|
||||
},
|
||||
"unable to synchronize channel "+
|
||||
"states: %v", err,
|
||||
@@ -1239,8 +1239,13 @@ func (l *channelLink) htlcManager() {
|
||||
}
|
||||
|
||||
case <-l.cfg.PendingCommitTicker.Ticks():
|
||||
l.fail(LinkFailureError{code: ErrRemoteUnresponsive},
|
||||
"unable to complete dance")
|
||||
l.fail(
|
||||
LinkFailureError{
|
||||
code: ErrRemoteUnresponsive,
|
||||
FailureAction: LinkFailureDisconnect,
|
||||
},
|
||||
"unable to complete dance",
|
||||
)
|
||||
return
|
||||
|
||||
// A message from the switch was just received. This indicates
|
||||
|
||||
Reference in new issue
Block a user