Skip to content

Commit

Permalink
lnwire: remove unused MaxMessagePayload const
Browse files Browse the repository at this point in the history
MaxMessagePayload and MaxSliceLength are duplicate variables. This
commit deletes MaxMessagePayload and keeps MaxSliceLength.
  • Loading branch information
yyforyongyu committed Aug 9, 2021
1 parent 90db8de commit 4b12f40
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion buffer/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// ReadSize represents the size of the maximum message that can be read off the
// wire by brontide. The buffer is used to hold the ciphertext while the
// brontide state machine decrypts the message.
const ReadSize = lnwire.MaxMessagePayload + 16
const ReadSize = lnwire.MaxSliceLength + 16

// Read is a static byte array sized to the maximum-allowed Lightning message
// size, plus 16 bytes for the MAC.
Expand Down
2 changes: 1 addition & 1 deletion buffer/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// WriteSize represents the size of the maximum plaintext message than can be
// sent using brontide. The buffer does not include extra space for the MAC, as
// that is applied by the Noise protocol after encrypting the plaintext.
const WriteSize = lnwire.MaxMessagePayload
const WriteSize = lnwire.MaxSliceLength

// Write is static byte array occupying to maximum-allowed plaintext-message
// size.
Expand Down
4 changes: 0 additions & 4 deletions lnwire/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"io"
)

// MaxMessagePayload is the maximum bytes a message can be regardless of other
// individual limits imposed by messages themselves.
const MaxMessagePayload = 65535 // 65KB

// MessageType is the unique 2 byte big-endian integer that indicates the type
// of message on the wire. All messages have a very simple header which
// consists simply of 2-byte message type. We omit a length field, and checksum
Expand Down

0 comments on commit 4b12f40

Please sign in to comment.