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

Function hsmd_send_init_reply_failure

hsmd/hsmd.c:281–301  ·  view source on GitHub ↗

Send an init reply failure message to lightningd and then call status_failed */

Source from the content-addressed store, hash-verified

279
280/* Send an init reply failure message to lightningd and then call status_failed */
281static void hsmd_send_init_reply_failure(enum hsm_secret_error error_code, enum status_failreason reason, const char *error_msg, ...)
282{
283 u8 *msg;
284 va_list ap;
285 char *formatted_msg;
286
287 va_start(ap, error_msg);
288 formatted_msg = tal_vfmt(tmpctx, error_msg, ap);
289 va_end(ap);
290
291 /* Send the init reply failure first */
292 msg = towire_hsmd_init_reply_failure(NULL, error_code, formatted_msg);
293 if (msg) {
294 /* Send directly to lightningd via REQ_FD */
295 wire_sync_write(REQ_FD, msg);
296 tal_free(msg);
297 }
298
299 /* Then call status_failed with the error message */
300 status_failed(reason, "%s", formatted_msg);
301}
302
303static void create_hsm(int fd, const char *passphrase)
304{

Callers 2

create_hsmFunction · 0.85
load_hsmFunction · 0.85

Calls 3

tal_freeFunction · 0.85
wire_sync_writeFunction · 0.50
status_failedFunction · 0.50

Tested by

no test coverage detected