mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-26 15:57:40 +02:00
lnrpc: receive custom message
This commit is contained in:
@@ -240,7 +240,7 @@ func TestMaxOutPointIndex(t *testing.T) {
|
||||
func TestEmptyMessageUnknownType(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
fakeType := MessageType(math.MaxUint16)
|
||||
fakeType := CustomTypeStart - 1
|
||||
if _, err := makeEmptyMessage(fakeType); err == nil {
|
||||
t.Fatalf("should not be able to make an empty message of an " +
|
||||
"unknown type")
|
||||
|
@@ -233,7 +233,12 @@ func makeEmptyMessage(msgType MessageType) (Message, error) {
|
||||
case MsgGossipTimestampRange:
|
||||
msg = &GossipTimestampRange{}
|
||||
default:
|
||||
return nil, &UnknownMessage{msgType}
|
||||
if msgType < CustomTypeStart {
|
||||
return nil, &UnknownMessage{msgType}
|
||||
}
|
||||
msg = &Custom{
|
||||
Type: msgType,
|
||||
}
|
||||
}
|
||||
|
||||
return msg, nil
|
||||
|
Reference in New Issue
Block a user