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

Function param_msat_u32

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

3864/* Fee base is a u32, but it's convenient to let them specify it using
3865 * msat etc. suffix. */
3866static struct command_result *param_msat_u32(struct command *cmd,
3867 const char *name,
3868 const char *buffer,
3869 const jsmntok_t *tok,
3870 u32 **num)
3871{
3872 struct amount_msat *msat;
3873 struct command_result *res;
3874
3875 /* Parse just like an msat. */
3876 res = param_msat(cmd, name, buffer, tok, &msat);
3877 if (res)
3878 return res;
3879
3880 *num = tal(cmd, u32);
3881 if (!amount_msat_to_u32(*msat, *num)) {
3882 return command_fail_badparam(cmd, name, buffer, tok,
3883 "exceeds u32 max");
3884 }
3885
3886 return NULL;
3887}
3888
3889static void set_channel_config(struct command *cmd, struct channel *channel,
3890 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