diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp --- a/src/wallet/sqlite.cpp +++ b/src/wallet/sqlite.cpp @@ -50,6 +50,14 @@ 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))); + } } // This is a no-op if sqlite3 is already initialized int ret = sqlite3_initialize();