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:
@@ -1613,9 +1613,9 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
|
|||||||
const jsmntok_t *toks,
|
const jsmntok_t *toks,
|
||||||
const jsmntok_t *idtok,
|
const jsmntok_t *idtok,
|
||||||
struct plugin *plugin,
|
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;
|
const char *err;
|
||||||
|
|
||||||
*disabled = NULL;
|
*disabled = NULL;
|
||||||
@@ -1635,12 +1635,10 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamictok = json_get_member(buffer, resulttok, "dynamic");
|
err = bool_setting(plugin, "getmanifest", buffer, resulttok, "dynamic",
|
||||||
if (dynamictok && !json_to_bool(buffer, dynamictok, &plugin->dynamic)) {
|
&plugin->dynamic);
|
||||||
return tal_fmt(plugin, "Bad 'dynamic' field ('%.*s')",
|
if (err)
|
||||||
json_tok_full_len(dynamictok),
|
return err;
|
||||||
json_tok_full(buffer, dynamictok));
|
|
||||||
}
|
|
||||||
|
|
||||||
featurestok = json_get_member(buffer, resulttok, "featurebits");
|
featurestok = json_get_member(buffer, resulttok, "featurebits");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user