diff --git a/lightningd/plugin.c b/lightningd/plugin.c index d69bac61d4b7..8e36efd6a637 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -2391,8 +2391,11 @@ void *plugins_exclusive_loop(struct plugin **plugins) io_conn_exclusive(plugins[i]->stdout_conn, true); } + /* We don't want to try to open another transaction: we're in one! */ + plugins[0]->plugins->want_db_transaction = false; /* We don't service timers here, either! */ ret = io_loop(NULL, NULL); + plugins[0]->plugins->want_db_transaction = true; log_debug(plugins[0]->plugins->ld->log, "io_loop: %s", __func__); for (i = 0; i < tal_count(plugins); ++i) { diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index 313c518fa025..62dc9d438ec4 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -360,10 +360,7 @@ void plugin_hook_db_sync(struct db *db) plugin_request_send(plugin_arr[i], req); } - /* We don't want to try to open another transaction: we're in one! */ - plugins->want_db_transaction = false; ret = plugins_exclusive_loop(plugin_arr); - plugins->want_db_transaction = true; /* We can be called on way out of an io_loop, which is already breaking. * That will make this immediately return; save the break value and call