diff options
| author | Bitflash <admin@bitflash.network> | 2026-08-17 10:37:07 -0300 |
|---|---|---|
| committer | Bitflash <admin@bitflash.network> | 2026-08-17 10:37:07 -0300 |
| commit | f7033201689c6eb70f16b242b9f90be548f67aa5 (patch) | |
| tree | e6ecab8a276afb007f341a498dd1a8553a756b0c /src/wallet_sqlite.cpp | |
| parent | c56af18e421dff78446399a630b5fa949fc487b3 (diff) | |
| parent | f9ee957bd6d3f28dfee166a82f389aad666a0119 (diff) | |
Merge pull request 'wallet: stage SQLite runtime loading' (#55) from wallet-sqlite-runtime into main
Diffstat (limited to 'src/wallet_sqlite.cpp')
| -rw-r--r-- | src/wallet_sqlite.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet_sqlite.cpp b/src/wallet_sqlite.cpp index 8489cac..ca81573 100644 --- a/src/wallet_sqlite.cpp +++ b/src/wallet_sqlite.cpp | |||
| @@ -58,6 +58,25 @@ bool CWalletDBSQLite::Open(const string& strPath, string& strError) | |||
| 58 | return true; | 58 | return true; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | bool CWalletDBSQLite::OpenReadOnly(const string& strPath, string& strError) | ||
| 62 | { | ||
| 63 | Close(); | ||
| 64 | |||
| 65 | int ret = sqlite3_open_v2(strPath.c_str(), &pdb, | ||
| 66 | SQLITE_OPEN_READONLY | | ||
| 67 | SQLITE_OPEN_FULLMUTEX, | ||
| 68 | NULL); | ||
| 69 | if (ret != SQLITE_OK) | ||
| 70 | { | ||
| 71 | SetSQLiteError(pdb, "cannot open SQLite wallet read-only", strError); | ||
| 72 | Close(); | ||
| 73 | return false; | ||
| 74 | } | ||
| 75 | |||
| 76 | sqlite3_busy_timeout(pdb, 5000); | ||
| 77 | return true; | ||
| 78 | } | ||
| 79 | |||
| 61 | void CWalletDBSQLite::Close() | 80 | void CWalletDBSQLite::Close() |
| 62 | { | 81 | { |
| 63 | if (pdb) | 82 | if (pdb) |