mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
json: move param node_id parser to common
Going to need this for a plugin that's external
This commit is contained in:
committed by
Rusty Russell
parent
8d28e52515
commit
19e65068a9
@@ -77,23 +77,6 @@ void json_add_txid(struct json_stream *result, const char *fieldname,
|
||||
json_add_string(result, fieldname, hex);
|
||||
}
|
||||
|
||||
struct command_result *param_node_id(struct command *cmd,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok,
|
||||
struct node_id **id)
|
||||
{
|
||||
*id = tal(cmd, struct node_id);
|
||||
if (json_to_node_id(buffer, tok, *id))
|
||||
return NULL;
|
||||
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"'%s' should be a node id, not '%.*s'",
|
||||
name, json_tok_full_len(tok),
|
||||
json_tok_full(buffer, tok));
|
||||
}
|
||||
|
||||
|
||||
struct command_result *param_pubkey(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t *tok,
|
||||
struct pubkey **pubkey)
|
||||
|
||||
Reference in New Issue
Block a user