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

Function fail_destination_tok

plugins/spender/multifundchannel.c:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void fail_destination_tok(struct multifundchannel_destination *dest,
46 const char *buf,
47 const jsmntok_t *error)
48{
49 const char *err;
50 const jsmntok_t *data_tok;
51
52 err = json_scan(tmpctx, buf, error, "{code:%,message:%}",
53 JSON_SCAN(json_to_int, &dest->error_code),
54 JSON_SCAN_TAL(dest->mfc,
55 json_strdup,
56 &dest->error_message));
57 if (err)
58 plugin_err(dest->mfc->cmd->plugin,
59 "`fundchannel_complete` failure failed to parse %s",
60 err);
61
62 data_tok = json_get_member(buf, error, "data");
63 if (data_tok)
64 dest->error_data = json_strdup(dest->mfc, buf, data_tok);
65 else
66 dest->error_data = NULL;
67
68 fail_destination(dest);
69}
70
71void fail_destination_msg(struct multifundchannel_destination *dest,
72 enum jsonrpc_errcode error_code,

Callers 6

fundchannel_complete_errFunction · 0.85
fundchannel_start_errFunction · 0.85
connect_errFunction · 0.85
openchannel_signed_errFunction · 0.85
openchannel_update_errFunction · 0.85
openchannel_init_errFunction · 0.85

Calls 5

fail_destinationFunction · 0.85
json_scanFunction · 0.50
plugin_errFunction · 0.50
json_get_memberFunction · 0.50
json_strdupFunction · 0.50

Tested by

no test coverage detected