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

Function log_status_fail

lightningd/subd.c:384–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sd_msg_readFunction · 0.85

Calls 1

fromwire_status_failFunction · 0.50

Tested by

no test coverage detected