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

Function amount_sat_or_u64_option

plugins/funder.c:1684–1705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1682}
1683
1684static char *amount_sat_or_u64_option(struct command *cmd,
1685 const char *arg,
1686 bool check_only,
1687 u64 *amt)
1688{
1689 struct amount_sat sats;
1690 char *err;
1691
1692 err = u64_option(cmd, arg, false, &sats.satoshis); /* Raw: want sats below */
1693 if (err) {
1694 tal_free(err);
1695 if (!parse_amount_sat(&sats, arg, strlen(arg)))
1696 return tal_fmt(tmpctx,
1697 "Unable to parse option '%s'",
1698 arg);
1699 }
1700
1701 if (!check_only)
1702 *amt = sats.satoshis; /* Raw: convert to u64 */
1703
1704 return NULL;
1705}
1706
1707static bool jsonfmt_policy_mod(struct command *cmd,
1708 struct json_stream *js,

Callers

nothing calls this directly

Calls 3

u64_optionFunction · 0.85
tal_freeFunction · 0.85
parse_amount_satFunction · 0.50

Tested by

no test coverage detected