mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
lightningd: reuse code for "dynamic" getmanifest response parsing.
And clean up weird indent. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ba2c912a39
commit
ac4c396537
1 changed files with 6 additions and 8 deletions
|
@ -1613,9 +1613,9 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
|
|||
const jsmntok_t *toks,
|
||||
const jsmntok_t *idtok,
|
||||
struct plugin *plugin,
|
||||
const char **disabled)
|
||||
const char **disabled)
|
||||
{
|
||||
const jsmntok_t *resulttok, *dynamictok, *featurestok, *custommsgtok, *tok;
|
||||
const jsmntok_t *resulttok, *featurestok, *custommsgtok, *tok;
|
||||
const char *err;
|
||||
|
||||
*disabled = NULL;
|
||||
|
@ -1635,12 +1635,10 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
dynamictok = json_get_member(buffer, resulttok, "dynamic");
|
||||
if (dynamictok && !json_to_bool(buffer, dynamictok, &plugin->dynamic)) {
|
||||
return tal_fmt(plugin, "Bad 'dynamic' field ('%.*s')",
|
||||
json_tok_full_len(dynamictok),
|
||||
json_tok_full(buffer, dynamictok));
|
||||
}
|
||||
err = bool_setting(plugin, "getmanifest", buffer, resulttok, "dynamic",
|
||||
&plugin->dynamic);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
featurestok = json_get_member(buffer, resulttok, "featurebits");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue