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

Function mw_fail

plugins/spender/multiwithdraw.c:288–312  ·  view source on GitHub ↗

Use this instead of command_fail. */

Source from the content-addressed store, hash-verified

286}
287/* Use this instead of command_fail. */
288static struct command_result *
289mw_fail(struct multiwithdraw_command *mw, enum jsonrpc_errcode code,
290 const char *fmt, ...)
291{
292 va_list ap;
293 char *message;
294 struct json_stream *js;
295 size_t len;
296 const char *rawjson;
297
298 va_start(ap, fmt);
299 message = tal_vfmt(tmpctx, fmt, ap);
300 va_end(ap);
301
302 js = new_json_stream(tmpctx, mw->cmd, NULL);
303 json_object_start(js, NULL);
304 json_add_jsonrpc_errcode(js, "code", code);
305 json_add_string(js, "message", message);
306 json_object_end(js);
307
308 rawjson = json_out_contents(js->jout, &len);
309
310 return mw_perform_cleanup(mw,
311 take(tal_strndup(NULL, rawjson, len)));
312}
313
314/*-----------------------------------------------------------------------------
315Initiate Multiwithdraw

Callers 2

start_mwFunction · 0.85
mw_after_fundpsbtFunction · 0.85

Calls 7

new_json_streamFunction · 0.85
json_object_startFunction · 0.85
json_add_jsonrpc_errcodeFunction · 0.85
json_object_endFunction · 0.85
json_out_contentsFunction · 0.85
mw_perform_cleanupFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected