From 01361ab21b5193ab3fa0529ece7a474e8168e710 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Nov 2017 11:40:48 +1030 Subject: [PATCH] jsonrpc: wrap all calls in transaction. --- lightningd/jsonrpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 318814b35..7720fc562 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -506,7 +506,9 @@ static void parse_request(struct json_connection *jcon, const jsmntok_t tok[]) return; } + db_begin_transaction(jcon->ld->wallet->db); cmd->dispatch(jcon->current, jcon->buffer, params); + db_commit_transaction(jcon->ld->wallet->db); } static struct io_plan *write_json(struct io_conn *conn,