aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/sqlite.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-09-23 12:16:40 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-10-14 11:28:18 -0400
commitf023b7cac0eb16d3c1bf40f1f7898b290de4cc73 (patch)
tree909bb791b499df2e02375aa91414d826ba235123 /src/wallet/sqlite.cpp
parent6173269866306058fcb1cc825b9eb681838678ca (diff)
wallet: Enforce sqlite serialized threading mode
Diffstat (limited to 'src/wallet/sqlite.cpp')
-rw-r--r--src/wallet/sqlite.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp
index 8a6b547feb..02a161ecbd 100644
--- a/src/wallet/sqlite.cpp
+++ b/src/wallet/sqlite.cpp
@@ -48,6 +48,11 @@ SQLiteDatabase::SQLiteDatabase(const fs::path& dir_path, const fs::path& file_pa
if (ret != SQLITE_OK) {
throw std::runtime_error(strprintf("SQLiteDatabase: Failed to setup error log: %s\n", sqlite3_errstr(ret)));
}
+ // Force serialized threading mode
+ ret = sqlite3_config(SQLITE_CONFIG_SERIALIZED);
+ if (ret != SQLITE_OK) {
+ throw std::runtime_error(strprintf("SQLiteDatabase: Failed to configure serialized threading mode: %s\n", sqlite3_errstr(ret)));
+ }
}
int ret = sqlite3_initialize(); // This is a no-op if sqlite3 is already initialized
if (ret != SQLITE_OK) {