mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 17:47:01 +02:00
routing: remove paymentFailureInfo
We can remove paymentFailureInfo since we can gate the result interpretation on the source index, meaning that if we don't have a source index, we deal with an unknown payment outcome because we couldn't pinpoint the failing hop.
This commit is contained in:
@@ -126,7 +126,9 @@ func (i *interpretedResult) processSuccess(route *mcRoute) {
|
||||
|
||||
// processFail processes a failed payment attempt.
|
||||
func (i *interpretedResult) processFail(rt *mcRoute, failure paymentFailure) {
|
||||
if failure.info.IsNone() {
|
||||
// Not having a source index means that we were unable to decrypt the
|
||||
// error message.
|
||||
if failure.sourceIdx.IsNone() {
|
||||
i.processPaymentOutcomeUnknown(rt)
|
||||
return
|
||||
}
|
||||
@@ -136,16 +138,14 @@ func (i *interpretedResult) processFail(rt *mcRoute, failure paymentFailure) {
|
||||
failMsg lnwire.FailureMessage
|
||||
)
|
||||
|
||||
failure.info.WhenSome(
|
||||
func(r tlv.RecordT[tlv.TlvType0, paymentFailureInfo]) {
|
||||
r.Val.sourceIdx.WhenSome(
|
||||
func(r tlv.RecordT[tlv.TlvType0, uint8]) {
|
||||
idx = int(r.Val)
|
||||
},
|
||||
)
|
||||
failure.sourceIdx.WhenSome(
|
||||
func(r tlv.RecordT[tlv.TlvType0, uint8]) {
|
||||
idx = int(r.Val)
|
||||
|
||||
failure.msg.WhenSome(
|
||||
func(r tlv.RecordT[tlv.TlvType1,
|
||||
failureMessage]) {
|
||||
|
||||
r.Val.msg.WhenSome(
|
||||
func(r tlv.RecordT[tlv.TlvType1, failureMessage]) {
|
||||
failMsg = r.Val.FailureMessage
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user