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

Function mw_fail

plugins/spender/multiwithdraw.c:290–314  ·  view source on GitHub ↗

Use this instead of command_fail. */

Source from the content-addressed store, hash-verified

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

Callers 2

start_mwFunction · 0.85
mw_after_fundpsbtFunction · 0.85

Calls 7

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

Tested by

no test coverage detected