Browse Source

payalgo: correctly fail command in json_pay_failure.

In e46ce0fc84 I accidentally removed the
actual code which fails the command.  As a result, if we retry and it
succeeds later, we can end up "succeeding" the started-failing
command, causing us to hit the 'assert(!cmd->have_json_stream);' in
new_json_stream.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.2rc1
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
a455e5e218
  1. 3
      lightningd/payalgo.c

3
lightningd/payalgo.c

@ -225,6 +225,7 @@ static void json_pay_failure(struct pay *pay,
json_add_payment_fields(data, r->payment);
json_add_failures(data, "failures", &pay->pay_failures);
json_object_end(data);
command_failed(pay->cmd, data);
return;
case PAY_RHASH_ALREADY_USED:
@ -235,6 +236,7 @@ static void json_pay_failure(struct pay *pay,
json_add_num(data, "sendpay_tries", pay->sendpay_tries);
json_add_failures(data, "failures", &pay->pay_failures);
json_object_end(data);
command_failed(pay->cmd, data);
return;
case PAY_UNPARSEABLE_ONION:
@ -263,6 +265,7 @@ static void json_pay_failure(struct pay *pay,
fail->channel_update);
json_add_failures(data, "failures", &pay->pay_failures);
json_object_end(data);
command_failed(pay->cmd, data);
return;
case PAY_TRY_OTHER_ROUTE:

Loading…
Cancel
Save