htlcswitch/link: remove chan sync delay

Earlier this delay was needed to increase the likelihood that the DLP
scanario was successfully completed. Since we would risk the connection
being torn down, and the link exit, we could end up with the remote
marking the channel borked, but not finishing the force close.

With the previous set of commits, we should now trigger the force close
before we merk the channel borked, which should ensure we'll resume the
orocess on next restart/connect.
This commit is contained in:
Johan T. Halseth 2019-09-11 12:26:52 +02:00
parent 2a6ad6e634
commit 2d194c9672
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -615,21 +615,6 @@ func (l *channelLink) syncChanStates() error {
"ChannelPoint(%v)", l.channel.ChannelPoint())
}
// If we have a restored channel, we'll delay sending our channel
// reestablish message briefly to ensure we first have a stable
// connection. Sending the message will cause the remote peer to force
// close the channel, which currently may not be resumed reliably if the
// connection is being torn down simultaneously. This delay can be
// removed after the force close is reliable, but in the meantime it
// improves the reliability of successfully closing out the channel.
if chanState.HasChanStatus(channeldb.ChanStatusRestored) {
select {
case <-time.After(5 * time.Second):
case <-l.quit:
return ErrLinkShuttingDown
}
}
if err := l.cfg.Peer.SendMessage(true, localChanSyncMsg); err != nil {
return fmt.Errorf("Unable to send chan sync message for "+
"ChannelPoint(%v)", l.channel.ChannelPoint())