mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-29 21:52:52 +02:00
htlcswitch/link: remove channel reestablish deadline
Now that the link will remain ineligible until it receives channel_reestablish from the remote peer, we can remove the channel reestablish timeout entirely.
This commit is contained in:
@@ -640,10 +640,8 @@ func (l *channelLink) syncChanStates() error {
|
|||||||
|
|
||||||
var msgsToReSend []lnwire.Message
|
var msgsToReSend []lnwire.Message
|
||||||
|
|
||||||
// Next, we'll wait to receive the ChanSync message with a timeout
|
// Next, we'll wait indefinitely to receive the ChanSync message. The
|
||||||
// period. The first message sent MUST be the ChanSync message,
|
// first message sent MUST be the ChanSync message.
|
||||||
// otherwise, we'll terminate the connection.
|
|
||||||
chanSyncDeadline := time.After(time.Second * 30)
|
|
||||||
select {
|
select {
|
||||||
case msg := <-l.upstream:
|
case msg := <-l.upstream:
|
||||||
remoteChanSyncMsg, ok := msg.(*lnwire.ChannelReestablish)
|
remoteChanSyncMsg, ok := msg.(*lnwire.ChannelReestablish)
|
||||||
@@ -727,10 +725,6 @@ func (l *channelLink) syncChanStates() error {
|
|||||||
|
|
||||||
case <-l.quit:
|
case <-l.quit:
|
||||||
return ErrLinkShuttingDown
|
return ErrLinkShuttingDown
|
||||||
|
|
||||||
case <-chanSyncDeadline:
|
|
||||||
return fmt.Errorf("didn't receive ChannelReestablish before " +
|
|
||||||
"deadline")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user