This catches the case where their stdout closes (usually they're dead). */
| 836 | |
| 837 | /* This catches the case where their stdout closes (usually they're dead). */ |
| 838 | static 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 | |
| 860 | struct io_plan *plugin_stdin_conn_init(struct io_conn *conn, |
| 861 | struct plugin *plugin) |
nothing calls this directly
no test coverage detected