Skip to content

Commit d04f6a9

Browse files
committed
refactor: remove sqlite dir path back-and-forth conversion
1 parent 88b22ac commit d04f6a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/wallet/sqlite.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ Mutex SQLiteDatabase::g_sqlite_mutex;
112112
int SQLiteDatabase::g_sqlite_count = 0;
113113

114114
SQLiteDatabase::SQLiteDatabase(const fs::path& dir_path, const fs::path& file_path, const DatabaseOptions& options, bool mock)
115-
: WalletDatabase(), m_mock(mock), m_dir_path(fs::PathToString(dir_path)), m_file_path(fs::PathToString(file_path)), m_write_semaphore(1), m_use_unsafe_sync(options.use_unsafe_sync)
115+
: WalletDatabase(), m_mock(mock), m_dir_path(dir_path), m_file_path(fs::PathToString(file_path)), m_write_semaphore(1), m_use_unsafe_sync(options.use_unsafe_sync)
116116
{
117117
{
118118
LOCK(g_sqlite_mutex);
119119
LogPrintf("Using SQLite Version %s\n", SQLiteDatabaseVersion());
120-
LogPrintf("Using wallet %s\n", m_dir_path);
120+
LogPrintf("Using wallet %s\n", fs::PathToString(m_dir_path));
121121

122122
if (++g_sqlite_count == 1) {
123123
// Setup logging
@@ -253,7 +253,7 @@ void SQLiteDatabase::Open()
253253

254254
if (m_db == nullptr) {
255255
if (!m_mock) {
256-
TryCreateDirectories(fs::PathFromString(m_dir_path));
256+
TryCreateDirectories(m_dir_path);
257257
}
258258
int ret = sqlite3_open_v2(m_file_path.c_str(), &m_db, flags, nullptr);
259259
if (ret != SQLITE_OK) {

src/wallet/sqlite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class SQLiteDatabase : public WalletDatabase
104104
private:
105105
const bool m_mock{false};
106106

107-
const std::string m_dir_path;
107+
const fs::path m_dir_path;
108108

109109
const std::string m_file_path;
110110

0 commit comments

Comments
 (0)