| 1682 | } |
| 1683 | |
| 1684 | static 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 | |
| 1707 | static bool jsonfmt_policy_mod(struct command *cmd, |
| 1708 | struct json_stream *js, |
nothing calls this directly
no test coverage detected