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

Function log_status_fail

lightningd/subd.c:388–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388static bool log_status_fail(struct subd *sd, const u8 *msg)
389{
390 const char *name = NULL;
391 enum status_failreason failreason;
392 char *desc;
393
394 if (!fromwire_status_fail(msg, msg, &failreason, &desc))
395 return false;
396
397 /* No 'default:' here so gcc gives warning if a new type added */
398 switch (failreason) {
399 case STATUS_FAIL_MASTER_IO:
400 name = "STATUS_FAIL_MASTER_IO";
401 break;
402 case STATUS_FAIL_HSM_IO:
403 name = "STATUS_FAIL_HSM_IO";
404 break;
405 case STATUS_FAIL_GOSSIP_IO:
406 name = "STATUS_FAIL_GOSSIP_IO";
407 break;
408 case STATUS_FAIL_INTERNAL_ERROR:
409 name = "STATUS_FAIL_INTERNAL_ERROR";
410 break;
411 }
412 /* fromwire_status_fail() guarantees it's one of those... */
413 assert(name);
414
415 log_broken(sd->log, "%s: %s", name, desc);
416
417 if (sd->ld->dev_subdaemon_fail)
418 exit(1);
419
420 return true;
421}
422
423static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[1])
424{

Callers 1

sd_msg_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected