| 287 | } |
| 288 | |
| 289 | static struct command_result *notice_missing_funds(struct command *cmd, |
| 290 | struct splice_cmd *splice_cmd, |
| 291 | struct amount_sat *missing_funds, |
| 292 | struct amount_sat funds_needed, |
| 293 | struct amount_sat *funds_available) |
| 294 | { |
| 295 | if (!amount_sat_add(missing_funds, *missing_funds, funds_needed)) |
| 296 | return do_fail(cmd, splice_cmd, JSONRPC2_INVALID_PARAMS, |
| 297 | "Unable to add for missing_funds"); |
| 298 | if (!amount_sat_sub(missing_funds, *missing_funds, *funds_available)) |
| 299 | return do_fail(cmd, splice_cmd, JSONRPC2_INVALID_PARAMS, |
| 300 | "Unable to sub for missing_funds"); |
| 301 | *funds_available = AMOUNT_SAT(0); |
| 302 | plugin_log(cmd->plugin, LOG_DBG, " missing_funds detected, now %s", |
| 303 | fmt_amount_sat(tmpctx, *missing_funds)); |
| 304 | return NULL; |
| 305 | } |
| 306 | |
| 307 | #define NOTICE_MISSING(missing_funds, funds_needed, funds_available) \ |
| 308 | { \ |
nothing calls this directly
no test coverage detected