What changed, and why it matters
This commit removes an unused error variable and widens a test generator's range. It is a cleanup/test-coverage change with no apparent security relevance.
No security action required; treat as routine cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change deletes the stale ErrMaxPongBytesExceeded error from lnwire/pong.go because ping deserialization now accepts the full uint16 range. It also updates the randomized Ping test message generator to produce NumPongBytes across the full uint16 range (0..65535) instead of capping at MaxPongBytes (65531). This is a non-functional test/cleanup patch.
Changed components
lnwire/pong.golnwire/test_message.goInspect captured patch +1 / −6
diff --git a/lnwire/pong.go b/lnwire/pong.go
index b5fca24..f4e1002 100644
--- a/lnwire/pong.go
+++ b/lnwire/pong.go
@@ -2,7 +2,6 @@ package lnwire
import (
"bytes"
- "fmt"
"io"
)
@@ -11,10 +10,6 @@ import (
// 2 bytes, leaving 65531 bytes.
const MaxPongBytes = 65531
-// ErrMaxPongBytesExceeded indicates that the NumPongBytes field from the ping
-// message has exceeded MaxPongBytes.
-var ErrMaxPongBytesExceeded = fmt.Errorf("pong bytes exceeded")
-
// PongPayload is a set of opaque bytes sent in response to a ping message.
type PongPayload []byte
diff --git a/lnwire/test_message.go b/lnwire/test_message.go
index 498b591..64e94c0 100644
--- a/lnwire/test_message.go
+++ b/lnwire/test_message.go
@@ -1541,7 +1541,7 @@ var _ TestMessage = (*Ping)(nil)
//
// This is part of the TestMessage interface.
func (p *Ping) RandTestMessage(t *rapid.T) Message {
- numPongBytes := uint16(rapid.IntRange(0, int(MaxPongBytes)).Draw(
+ numPongBytes := uint16(rapid.IntRange(0, math.MaxUint16).Draw(
t, "numPongBytes"),
)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.