lnwire: Add BOLT#1 'init' message

'init' message is the first message reveals the features supported or required
by this node. Nodes wait for receipt of the other's features to simplify error
diagnosis where features are incompatible. This message will help negotioate the
the features which are supported by both sides.
This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2017-02-17 13:27:29 +08:00
1 parent 5560f032f6
commit 3dd619fb35
6 files changed
+566

No files matched your search

+4
View File
@@ -22,6 +22,8 @@ const MaxMessagePayload = 1024 * 1024 * 32 // 32MB
// Commands used in lightning message headers which detail the type of message.
const (
CmdInit = uint32(1)
// Commands for opening a channel funded by one party (single funder).
CmdSingleFundingRequest = uint32(100)
CmdSingleFundingResponse = uint32(110)
@@ -88,6 +90,8 @@ func makeEmptyMessage(command uint32) (Message, error) {
var msg Message
switch command {
case CmdInit:
msg = &Init{}
case CmdSingleFundingRequest:
msg = &SingleFundingRequest{}
case CmdSingleFundingResponse: