MCPcopy Create free account
hub / github.com/ElementsProject/lightning / param_feerate_style

Function param_feerate_style

lightningd/feerate.c:23–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23struct command_result *param_feerate_style(struct command *cmd,
24 const char *name,
25 const char *buffer,
26 const jsmntok_t *tok,
27 enum feerate_style **style)
28{
29 *style = tal(cmd, enum feerate_style);
30 if (json_tok_streq(buffer, tok,
31 feerate_style_name(FEERATE_PER_KSIPA))) {
32 **style = FEERATE_PER_KSIPA;
33 return NULL;
34 } else if (json_tok_streq(buffer, tok,
35 feerate_style_name(FEERATE_PER_KBYTE))) {
36 **style = FEERATE_PER_KBYTE;
37 return NULL;
38 }
39
40 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
41 "'%s' should be '%s' or '%s', not '%.*s'",
42 name,
43 feerate_style_name(FEERATE_PER_KSIPA),
44 feerate_style_name(FEERATE_PER_KBYTE),
45 json_tok_full_len(tok), json_tok_full(buffer, tok));
46}
47
48/* This can set **feerate to 0, if it's unknown. */
49static struct command_result *param_feerate_unchecked(struct command *cmd,

Callers

nothing calls this directly

Calls 5

json_tok_streqFunction · 0.85
feerate_style_nameFunction · 0.85
command_failFunction · 0.70
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected