lnwire: on Message interface convert Command to MsgType
This commit modifies the Message interface to convert the Command method to a MsgType method that uses a new set of message type for all the defined messages. These new messages types nearly exactly match the message types used within the current draft of the BOLT specifications.
This commit is contained in:
21 files changed
+119
-151
No files matched your search
+3
-5
@@ -1,9 +1,7 @@
|
||||
package lnwire
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
)
|
||||
@@ -92,12 +90,12 @@ func (c *Error) Encode(w io.Writer, pver uint32) error {
|
||||
)
|
||||
}
|
||||
|
||||
// Command returns the integer uniquely identifying an Error message on the
|
||||
// MsgType returns the integer uniquely identifying an Error message on the
|
||||
// wire.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (c *Error) Command() uint32 {
|
||||
return CmdError
|
||||
func (c *Error) MsgType() MessageType {
|
||||
return MsgError
|
||||
}
|
||||
|
||||
// MaxPayloadLength returns the maximum allowed payload size for a Error
|
||||
|
||||
Reference in new issue
Block a user