htlcswitch: synchronously send the chan sync message to the remote peer

In this commit, we modify the starting link logic to always send the
chan sync message to the remote peer in a synchronous manner. Otherwise,
it's possible that we fail very quickly below this block, and don't ever
send the message to the remote peer.
This commit is contained in:
Olaoluwa Osuntokun 2019-04-09 19:48:34 -07:00
parent 71e080a2fb
commit 5ac9ba6472
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -574,7 +574,7 @@ func (l *channelLink) syncChanStates() error {
return fmt.Errorf("unable to generate chan sync message for "+ return fmt.Errorf("unable to generate chan sync message for "+
"ChannelPoint(%v)", l.channel.ChannelPoint()) "ChannelPoint(%v)", l.channel.ChannelPoint())
} }
if err := l.cfg.Peer.SendMessage(false, localChanSyncMsg); err != nil { if err := l.cfg.Peer.SendMessage(true, localChanSyncMsg); err != nil {
return fmt.Errorf("Unable to send chan sync message for "+ return fmt.Errorf("Unable to send chan sync message for "+
"ChannelPoint(%v)", l.channel.ChannelPoint()) "ChannelPoint(%v)", l.channel.ChannelPoint())
} }