multi: allow invalid tlv data when decoding payment fail info

Older payments might have a invalid tlv stream, we now catch this
case and add a unit test.
This commit is contained in:
ziggie committed 2025-11-03 12:54:29 +01:00
1 parent 9a7b526c0c
commit 870d603ce5
5 files changed
+139 -3

No files matched your search

+11 -1
View File
@@ -2099,9 +2099,19 @@ func deserializeHTLCFailInfo(r io.Reader) (*HTLCFailInfo, error) {
f.Message, err = lnwire.DecodeFailureMessage(
bytes.NewReader(failureBytes), 0,
)
if err != nil {
if err != nil &&
!errors.Is(err, lnwire.ErrParsingExtraTLVBytes) {
return nil, err
}
// In case we have an invalid TLV stream regarding the extra
// tlv data we still continue with the decoding of the
// HTLCFailInfo.
if errors.Is(err, lnwire.ErrParsingExtraTLVBytes) {
log.Warnf("Failed to decode extra TLV bytes for "+
"failure message: %v", err)
}
}
var reason byte