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

Function notice_missing_funds

plugins/spender/splice.c:289–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289static 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 { \

Callers

nothing calls this directly

Calls 5

do_failFunction · 0.85
amount_sat_addFunction · 0.50
amount_sat_subFunction · 0.50
plugin_logFunction · 0.50
fmt_amount_satFunction · 0.50

Tested by

no test coverage detected