mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
lnwire: allow longer failure messages
This fixes an incompatibility where lnd enforces a strict 256 byte failure message, where as the spec sets this only as the recommended length.
This commit is contained in:
@@ -1264,9 +1264,9 @@ func DecodeFailure(r io.Reader, pver uint32) (FailureMessage, error) {
|
||||
|
||||
// Check the total length. Convert to 32 bits to prevent overflow.
|
||||
totalLength := uint32(padLength) + uint32(failureLength)
|
||||
if totalLength != FailureMessageLength {
|
||||
return nil, fmt.Errorf("failure message length is "+
|
||||
"incorrect: msg=%v, pad=%v, total=%v",
|
||||
if totalLength < FailureMessageLength {
|
||||
return nil, fmt.Errorf("failure message too short: "+
|
||||
"msg=%v, pad=%v, total=%v",
|
||||
failureLength, padLength, totalLength)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user