mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 16:55:13 +02:00
lnwire: remove MaxPayloadLength from Message interface
Removes the MaxPayloadLength function from the Message interface and checks that each message payload is not greater than MaxMsgBody. Since all messages are now allowed to be 65535 bytes in size, the MaxPayloadLength is no longer needed.
This commit is contained in:
@@ -250,9 +250,6 @@ func TestEmptyMessageUnknownType(t *testing.T) {
|
||||
// TestLightningWireProtocol uses the testing/quick package to create a series
|
||||
// of fuzz tests to attempt to break a primary scenario which is implemented as
|
||||
// property based testing scenario.
|
||||
//
|
||||
// Debug help: when the message payload can reach a size larger than the return
|
||||
// value of MaxPayloadLength, the test can panic without a helpful message.
|
||||
func TestLightningWireProtocol(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -274,9 +271,9 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
// the 2 bytes for the message type) is _below_ the specified
|
||||
// max payload size for this message.
|
||||
payloadLen := uint32(b.Len()) - 2
|
||||
if payloadLen > msg.MaxPayloadLength(0) {
|
||||
if payloadLen > MaxMsgBody {
|
||||
t.Fatalf("msg payload constraint violated: %v > %v",
|
||||
payloadLen, msg.MaxPayloadLength(0))
|
||||
payloadLen, MaxMsgBody)
|
||||
return false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user