mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 09:34:24 +01:00
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>
This commit is contained in:
committed by
Christian Decker
parent
c5cd4791be
commit
a455e5e218
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user