Skip to content

Commit

Permalink
wallet: Enforce sqlite serialized threading mode
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Oct 14, 2020
1 parent 6173269 commit f023b7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wallet/sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f023b7c

Please sign in to comment.