mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
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:
parent
f5c3f930c4
commit
110c99f676
2 changed files with 9 additions and 18 deletions
|
@ -215,20 +215,9 @@ func (i *interpretedResult) processPaymentOutcomeFinal(
|
||||||
i.finalFailureReason = &reasonIncorrectDetails
|
i.finalFailureReason = &reasonIncorrectDetails
|
||||||
|
|
||||||
case *lnwire.FailMPPTimeout:
|
case *lnwire.FailMPPTimeout:
|
||||||
// TODO(carla): decide how to penalize mpp timeout. In the
|
// Assign all pairs a success result, as the payment reached the
|
||||||
// meantime, attribute success to the hops along the route and
|
// destination correctly. Continue the payment process.
|
||||||
// do not penalize the final node.
|
i.successPairRange(route, 0, n-1)
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// All other errors are considered terminal if coming from the
|
// All other errors are considered terminal if coming from the
|
||||||
|
|
|
@ -325,7 +325,9 @@ var resultTestCases = []resultTestCase{
|
||||||
failure: &lnwire.FailMPPTimeout{},
|
failure: &lnwire.FailMPPTimeout{},
|
||||||
|
|
||||||
expectedResult: &interpretedResult{
|
expectedResult: &interpretedResult{
|
||||||
finalFailureReason: &reasonError,
|
pairResults: map[DirectedNodePair]pairResult{
|
||||||
|
getTestPair(0, 1): successPairResult(100),
|
||||||
|
},
|
||||||
nodeFailure: nil,
|
nodeFailure: nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -342,8 +344,8 @@ var resultTestCases = []resultTestCase{
|
||||||
expectedResult: &interpretedResult{
|
expectedResult: &interpretedResult{
|
||||||
pairResults: map[DirectedNodePair]pairResult{
|
pairResults: map[DirectedNodePair]pairResult{
|
||||||
getTestPair(0, 1): successPairResult(100),
|
getTestPair(0, 1): successPairResult(100),
|
||||||
|
getTestPair(1, 2): successPairResult(99),
|
||||||
},
|
},
|
||||||
finalFailureReason: &reasonError,
|
|
||||||
nodeFailure: nil,
|
nodeFailure: nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue