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

Function plugin_conn_finish

lightningd/plugin.c:838–858  ·  view source on GitHub ↗

This catches the case where their stdout closes (usually they're dead). */

Source from the content-addressed store, hash-verified

836
837/* This catches the case where their stdout closes (usually they're dead). */
838static void plugin_conn_finish(struct io_conn *conn, struct plugin *plugin)
839{
840 struct db *db;
841
842 /* If they die during startup (plugins_init) wallet is NULL
843 * (but there are also no plugin commands to kill, so nothing
844 * would ever try to access db */
845 if (plugin->plugins->ld->wallet) {
846 db = plugin->plugins->ld->wallet->db;
847 db_begin_transaction(db);
848 } else
849 db = NULL;
850
851 /* This is expected at shutdown of course. */
852 plugin_kill(plugin,
853 plugin->plugins->ld->state == LD_STATE_SHUTDOWN
854 ? LOG_DBG : LOG_INFORM,
855 "exited %s", state_desc(plugin));
856 if (db)
857 db_commit_transaction(db);
858}
859
860struct io_plan *plugin_stdin_conn_init(struct io_conn *conn,
861 struct plugin *plugin)

Callers

nothing calls this directly

Calls 3

plugin_killFunction · 0.85
state_descFunction · 0.85
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected