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

Function handle_version

lightningd/subd.c:454–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sd_msg_readFunction · 0.85

Calls 4

io_breakFunction · 0.85
msg_wakeFunction · 0.85
fromwire_status_versionFunction · 0.50
versionFunction · 0.50

Tested by

no test coverage detected