Browse Source

routing: continue trying after mpp timeout

It can happen that the receiver times out some htlcs of the set if it
took to long to complete. But because the sender's mission control is
now updated, it is worth to keep trying to send those shards again.
master
Joost Jager 4 years ago
parent
commit
110c99f676
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
  1. 17
      routing/result_interpretation.go
  2. 10
      routing/result_interpretation_test.go

17
routing/result_interpretation.go

@ -215,20 +215,9 @@ func (i *interpretedResult) processPaymentOutcomeFinal(
i.finalFailureReason = &reasonIncorrectDetails
case *lnwire.FailMPPTimeout:
// TODO(carla): decide how to penalize mpp timeout. In the
// meantime, attribute success to the hops along the route and
// do not penalize the final node.
i.finalFailureReason = &reasonError
// If this is a direct payment, take no action.
if n == 1 {
return
}
// Assign all pairs a success result except the final hop, as
// the payment reached the destination correctly.
i.successPairRange(route, 0, n-2)
// Assign all pairs a success result, as the payment reached the
// destination correctly. Continue the payment process.
i.successPairRange(route, 0, n-1)
default:
// All other errors are considered terminal if coming from the

10
routing/result_interpretation_test.go

@ -325,8 +325,10 @@ var resultTestCases = []resultTestCase{
failure: &lnwire.FailMPPTimeout{},
expectedResult: &interpretedResult{
finalFailureReason: &reasonError,
nodeFailure: nil,
pairResults: map[DirectedNodePair]pairResult{
getTestPair(0, 1): successPairResult(100),
},
nodeFailure: nil,
},
},
@ -342,9 +344,9 @@ var resultTestCases = []resultTestCase{
expectedResult: &interpretedResult{
pairResults: map[DirectedNodePair]pairResult{
getTestPair(0, 1): successPairResult(100),
getTestPair(1, 2): successPairResult(99),
},
finalFailureReason: &reasonError,
nodeFailure: nil,
nodeFailure: nil,
},
},
}

Loading…
Cancel
Save