mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
Add assertions to clarify our assumptions about msg != NULL
This commit is contained in:
parent
ea3ee01215
commit
f351417905
@ -636,8 +636,8 @@ static void json_sendpay_on_resolve(const struct sendpay_result *r,
|
||||
{
|
||||
struct command *cmd = (struct command*) vcmd;
|
||||
|
||||
struct json_result *data;
|
||||
const char *msg;
|
||||
struct json_result *data = NULL;
|
||||
const char *msg = NULL;
|
||||
struct routing_failure *fail;
|
||||
|
||||
if (r->succeeded)
|
||||
@ -693,6 +693,7 @@ static void json_sendpay_on_resolve(const struct sendpay_result *r,
|
||||
break;
|
||||
}
|
||||
|
||||
assert(msg);
|
||||
command_fail_detailed(cmd, r->errorcode, data, "%s", msg);
|
||||
}
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ json_pay_success(struct command *cmd,
|
||||
static void json_pay_failure(struct command *cmd,
|
||||
const struct sendpay_result *r)
|
||||
{
|
||||
struct json_result *data;
|
||||
const char *msg;
|
||||
struct json_result *data = NULL;
|
||||
const char *msg = NULL;
|
||||
struct routing_failure *fail;
|
||||
|
||||
assert(!r->succeeded);
|
||||
@ -109,6 +109,7 @@ static void json_pay_failure(struct command *cmd,
|
||||
break;
|
||||
}
|
||||
|
||||
assert(msg);
|
||||
command_fail_detailed(cmd, r->errorcode, data, "%s", msg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user