v31.1-roots.1 · Commit 6: [PATCH 06/17] feat(wallet): preserve Roots signing and spend controls on v31
src/wallet/sqlite.cpp
Before: src/wallet/sqlite.cpp · After: src/wallet/sqlite.cpp
File metadata
index e72455a3be14caa20d98a6bb61b29e7d2fb40c8d..cd7aff813b837dd8cec3f88079b8a43571332b71 100644
Download original patch · Release notes
Diff rows 1–9 of 9. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/wallet/sqlite.cpp
CHANGED
|
@@ -251,6 +251,9 @@ void SQLiteDatabase::Open()
|
|
| 251 |
if (m_db == nullptr) {
|
| 252 |
if (!m_mock) {
|
| 253 |
TryCreateDirectories(m_dir_path);
|
|
|
|
|
|
|
|
|
|
| 254 |
}
|
| 255 |
int ret = sqlite3_open_v2(m_file_path.c_str(), &m_db, flags, nullptr);
|
| 256 |
if (ret != SQLITE_OK) {
|
|
|
|
| 251 |
if (m_db == nullptr) {
|
| 252 |
if (!m_mock) {
|
| 253 |
TryCreateDirectories(m_dir_path);
|
| 254 |
+
if (!IsDirWritable(m_dir_path)) {
|
| 255 |
+
throw std::runtime_error(strprintf("SQLiteDatabase: Failed to open database in directory '%s': directory is not writable", fs::PathToString(m_dir_path)));
|
| 256 |
+
}
|
| 257 |
}
|
| 258 |
int ret = sqlite3_open_v2(m_file_path.c_str(), &m_db, flags, nullptr);
|
| 259 |
if (ret != SQLITE_OK) {
|