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

Function param_msat_u32

lightningd/peer_control.c:2495–2516  ·  view source on GitHub ↗

Fee base is a u32, but it's convenient to let them specify it using * msat etc. suffix. */

Source from the content-addressed store, hash-verified

2493/* Fee base is a u32, but it's convenient to let them specify it using
2494 * msat etc. suffix. */
2495static struct command_result *param_msat_u32(struct command *cmd,
2496 const char *name,
2497 const char *buffer,
2498 const jsmntok_t *tok,
2499 u32 **num)
2500{
2501 struct amount_msat *msat;
2502 struct command_result *res;
2503
2504 /* Parse just like an msat. */
2505 res = param_msat(cmd, name, buffer, tok, &msat);
2506 if (res)
2507 return res;
2508
2509 *num = tal(cmd, u32);
2510 if (!amount_msat_to_u32(*msat, *num)) {
2511 return command_fail_badparam(cmd, name, buffer, tok,
2512 "exceeds u32 max");
2513 }
2514
2515 return NULL;
2516}
2517
2518static void set_channel_config(struct command *cmd, struct channel *channel,
2519 u32 *base,

Callers

nothing calls this directly

Calls 3

amount_msat_to_u32Function · 0.85
command_fail_badparamFunction · 0.85
param_msatFunction · 0.50

Tested by

no test coverage detected