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

Function commando_error

plugins/commando.c:202–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 PRINTF_FMT(3,4);
201
202static void commando_error(struct commando *incoming,
203 int ecode,
204 const char *fmt, ...)
205{
206 struct reply *reply = tal(plugin, struct reply);
207 va_list ap;
208
209 reply->incoming = tal_steal(reply, incoming);
210 reply->buf = tal_fmt(reply, "{\"error\":{\"code\":%i,\"message\":\"", ecode);
211 va_start(ap, fmt);
212 tal_append_vfmt(&reply->buf, fmt, ap);
213 va_end(ap);
214 tal_append_fmt(&reply->buf, "\"}}");
215 reply->off = 0;
216 reply->len = tal_bytelen(reply->buf) - 1;
217
218 send_response(NULL, NULL, NULL, reply);
219}
220
221struct cond_info {
222 const struct node_id *peer;

Callers 1

try_commandFunction · 0.85

Calls 4

tal_append_vfmtFunction · 0.85
tal_append_fmtFunction · 0.85
tal_bytelenFunction · 0.85
send_responseFunction · 0.85

Tested by

no test coverage detected