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

Function handle_version

lightningd/subd.c:459–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459static bool handle_version(struct subd *sd, const u8 *msg)
460{
461 char *ver;
462
463 if (!fromwire_status_version(msg, msg, &ver))
464 return false;
465
466 if (!streq(ver, version())) {
467 log_broken(sd->log, "version '%s' not '%s': restarting",
468 ver, version());
469 sd->ld->try_reexec = true;
470 /* Return us to toplevel lightningd.c */
471 log_debug(sd->ld->log, "io_break: %s", __func__);
472 io_break(sd->ld);
473 return false;
474 }
475
476 sd->rcvd_version = true;
477 /* In case there are outgoing msgs, we can send now. */
478 msg_wake(sd->outq);
479
480 return true;
481}
482
483static struct io_plan *sd_msg_read(struct io_conn *conn, struct subd *sd)
484{

Callers 1

sd_msg_readFunction · 0.85

Calls 3

versionFunction · 0.85
io_breakFunction · 0.85
msg_wakeFunction · 0.85

Tested by

no test coverage detected