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

Function param_msat_u32

lightningd/peer_control.c:3588–3609  ·  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

3586/* Fee base is a u32, but it's convenient to let them specify it using
3587 * msat etc. suffix. */
3588static struct command_result *param_msat_u32(struct command *cmd,
3589 const char *name,
3590 const char *buffer,
3591 const jsmntok_t *tok,
3592 u32 **num)
3593{
3594 struct amount_msat *msat;
3595 struct command_result *res;
3596
3597 /* Parse just like an msat. */
3598 res = param_msat(cmd, name, buffer, tok, &msat);
3599 if (res)
3600 return res;
3601
3602 *num = tal(cmd, u32);
3603 if (!amount_msat_to_u32(*msat, *num)) {
3604 return command_fail_badparam(cmd, name, buffer, tok,
3605 "exceeds u32 max");
3606 }
3607
3608 return NULL;
3609}
3610
3611static void set_channel_config(struct command *cmd, struct channel *channel,
3612 u32 *base,

Callers

nothing calls this directly

Calls 3

param_msatFunction · 0.85
amount_msat_to_u32Function · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected