json: helper to parse pubkeys.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-11 20:33:50 +10:30
committed by Christian Decker
parent 8430e33f3b
commit 79ebb9dfd0
5 changed files with 15 additions and 9 deletions

View File

@@ -352,6 +352,13 @@ void json_add_pubkey(struct json_result *response,
json_add_hex(response, fieldname, der, sizeof(der));
}
bool json_tok_pubkey(const char *buffer, const jsmntok_t *tok,
struct pubkey *pubkey)
{
return pubkey_from_hexstr(buffer + tok->start,
tok->end - tok->start, pubkey);
}
void json_add_short_channel_id(struct json_result *response,
const char *fieldname,
const struct short_channel_id *id)