Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/sqlite.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | : WalletDatabase(), m_mock(mock), m_dir_path(dir_path.string()), | ||||
// Setup logging | // Setup logging | ||||
int ret = | int ret = | ||||
sqlite3_config(SQLITE_CONFIG_LOG, ErrorLogCallback, nullptr); | sqlite3_config(SQLITE_CONFIG_LOG, ErrorLogCallback, nullptr); | ||||
if (ret != SQLITE_OK) { | if (ret != SQLITE_OK) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("SQLiteDatabase: Failed to setup error log: %s\n", | strprintf("SQLiteDatabase: Failed to setup error log: %s\n", | ||||
sqlite3_errstr(ret))); | 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 | // This is a no-op if sqlite3 is already initialized | ||||
int ret = sqlite3_initialize(); | int ret = sqlite3_initialize(); | ||||
if (ret != SQLITE_OK) { | if (ret != SQLITE_OK) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("SQLiteDatabase: Failed to initialize SQLite: %s\n", | strprintf("SQLiteDatabase: Failed to initialize SQLite: %s\n", | ||||
sqlite3_errstr(ret))); | sqlite3_errstr(ret))); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 694 Lines • Show Last 20 Lines |