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

Function param_feerate

lightningd/feerate.c:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48struct command_result *param_feerate(struct command *cmd, const char *name,
49 const char *buffer, const jsmntok_t *tok,
50 u32 **feerate)
51{
52 for (size_t i = 0; i < NUM_FEERATES; i++) {
53 if (json_tok_streq(buffer, tok, feerate_name(i)))
54 return param_feerate_estimate(cmd, feerate, i);
55 }
56 /* We used SLOW, NORMAL, and URGENT as feerate targets previously,
57 * and many commands rely on this syntax now.
58 * It's also really more natural for an user interface. */
59 if (json_tok_streq(buffer, tok, "slow"))
60 return param_feerate_estimate(cmd, feerate, FEERATE_MIN);
61 else if (json_tok_streq(buffer, tok, "normal"))
62 return param_feerate_estimate(cmd, feerate, FEERATE_OPENING);
63 else if (json_tok_streq(buffer, tok, "urgent"))
64 return param_feerate_estimate(cmd, feerate, FEERATE_UNILATERAL_CLOSE);
65
66 /* It's a number... */
67 return param_feerate_val(cmd, name, buffer, tok, feerate);
68}
69
70struct command_result *param_feerate_estimate(struct command *cmd,
71 u32 **feerate_per_kw,

Callers 1

param_feerate_rangeFunction · 0.85

Calls 4

feerate_nameFunction · 0.85
param_feerate_estimateFunction · 0.85
param_feerate_valFunction · 0.85
json_tok_streqFunction · 0.50

Tested by

no test coverage detected