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.
This commit is contained in:
Joost Jager 2020-03-25 16:21:58 +01:00
parent f5c3f930c4
commit 110c99f676
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
2 changed files with 9 additions and 18 deletions

@ -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

@ -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,
},
},
}