routing: account for payment terminal errors

If we have processed a terminal state while we're pathfinding
for another shard, the payment loop should not error out on
ErrPaymentTerminal. Instead, it would wait for our shards to
complete then cleanly exit.
This commit is contained in:
carla committed 2021-04-23 08:46:22 +02:00
1 parent 58d95be4dd
commit a63640c488
2 files changed
+16 -7

No files matched your search

+4 -6
View File
@@ -618,10 +618,8 @@ func TestRouterPaymentStateMachine(t *testing.T) {
{
// A MP payment scenario when our path finding returns
// after we've just received a terminal failure, and
// demonstrates a bug where the payment will return with
// and "unexpected" ErrPaymentTerminal rather than
// failing with a permanent error. This results in the
// payment getting stuck.
// attempts to dispatch a new shard. Testing that we
// correctly abandon the shard and conclude the payment.
name: "MP path found after failure",
steps: []string{
@@ -648,7 +646,7 @@ func TestRouterPaymentStateMachine(t *testing.T) {
routes: []*route.Route{
shard, shard,
},
paymentErr: channeldb.ErrPaymentTerminal,
paymentErr: channeldb.FailureReasonPaymentDetails,
},
{
// A MP payment scenario when our path finding returns
@@ -698,7 +696,7 @@ func TestRouterPaymentStateMachine(t *testing.T) {
routes: []*route.Route{
shard, shard, shard, shard,
},
paymentErr: channeldb.ErrPaymentTerminal,
paymentErr: channeldb.FailureReasonPaymentDetails,
},
}