routing: make msg and index optional

This is later used to handle their nil values.
This commit is contained in:
bitromortac committed 2025-04-30 17:42:53 +02:00
1 parent bc4229b32e
commit e5c541407f
2 files changed
+61 -10

No files matched your search

+11 -2
View File
@@ -138,8 +138,17 @@ func (i *interpretedResult) processFail(rt *mcRoute, failure paymentFailure) {
failure.info.WhenSome(
func(r tlv.RecordT[tlv.TlvType0, paymentFailureInfo]) {
idx = int(r.Val.sourceIdx.Val)
failMsg = r.Val.msg.Val.FailureMessage
r.Val.sourceIdx.WhenSome(
func(r tlv.RecordT[tlv.TlvType0, uint8]) {
idx = int(r.Val)
},
)
r.Val.msg.WhenSome(
func(r tlv.RecordT[tlv.TlvType1, failureMessage]) {
failMsg = r.Val.FailureMessage
},
)
},
)