lnwire: add BOLT#2 channel reestablish message

In this commit the reestablish message have been added, which serves as
channel state synchronization message. Before exchanging the messages
for particular channel peers have to send it to each other as the
first message in order to be sure that non of the updates have been
lost because of the previous disconnect.
This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2017-11-09 16:38:56 -08:00
1 parent 3764e5c65e
commit f29b4f60e4
3 files changed
+84

No files matched your search

+5
View File
@@ -40,6 +40,7 @@ const (
MsgCommitSig = 132
MsgRevokeAndAck = 133
MsgUpdateFailMalformedHTLC = 135
MsgChannelReestablish = 136
MsgUpdateFee = 137
MsgChannelAnnouncement = 256
MsgNodeAnnouncement = 257
@@ -78,6 +79,8 @@ func (t MessageType) String() string {
return "RevokeAndAck"
case MsgUpdateFailMalformedHTLC:
return "UpdateFailMalformedHTLC"
case MsgChannelReestablish:
return "ChannelReestablish"
case MsgError:
return "Error"
case MsgChannelAnnouncement:
@@ -169,6 +172,8 @@ func makeEmptyMessage(msgType MessageType) (Message, error) {
msg = &UpdateFee{}
case MsgUpdateFailMalformedHTLC:
msg = &UpdateFailMalformedHTLC{}
case MsgChannelReestablish:
msg = &ChannelReestablish{}
case MsgError:
msg = &Error{}
case MsgChannelAnnouncement: