| 1254 | |
| 1255 | |
| 1256 | static struct command_result * |
| 1257 | param_policy_mod(struct command *cmd, const char *name, |
| 1258 | const char *buffer, const jsmntok_t *tok, |
| 1259 | u64 **mod) |
| 1260 | { |
| 1261 | struct amount_sat sats; |
| 1262 | char *arg_str, *err; |
| 1263 | |
| 1264 | *mod = tal(cmd, u64); |
| 1265 | arg_str = tal_strndup(cmd, buffer + tok->start, |
| 1266 | tok->end - tok->start); |
| 1267 | |
| 1268 | err = u64_option(cmd, arg_str, false, *mod); |
| 1269 | if (err) { |
| 1270 | tal_free(err); |
| 1271 | if (!parse_amount_sat(&sats, arg_str, strlen(arg_str))) |
| 1272 | return command_fail_badparam(cmd, name, |
| 1273 | buffer, tok, err); |
| 1274 | |
| 1275 | **mod = sats.satoshis; /* Raw: convert to u64 */ |
| 1276 | } |
| 1277 | |
| 1278 | return NULL; |
| 1279 | } |
| 1280 | |
| 1281 | static struct command_result * |
| 1282 | parse_lease_rates(struct command *cmd, const char *buffer, |
nothing calls this directly
no test coverage detected