diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -118,7 +118,7 @@ CDBWrapper::CDBWrapper(const fs::path &path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate) - : m_name(fs::basename(path)) { + : m_name{path.stem().string()} { penv = nullptr; readoptions.verify_checksums = true; iteroptions.verify_checksums = true; diff --git a/src/fs.h b/src/fs.h --- a/src/fs.h +++ b/src/fs.h @@ -11,6 +11,7 @@ #include #endif +#define BOOST_FILESYSTEM_NO_DEPRECATED #include #include diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -435,14 +435,6 @@ DbEnv::version(nullptr, nullptr, nullptr)); LogPrintf("Using wallet %s\n", file_path.string()); - // Wallet file must be a plain filename without a directory - if (walletFile != fs::basename(walletFile) + fs::extension(walletFile)) { - errorStr = strprintf( - _("Wallet %s resides outside wallet directory %s").translated, - walletFile, walletDir.string()); - return false; - } - if (!env->Open(true /* retry */)) { errorStr = strprintf( _("Error initializing wallet database environment %s!").translated, diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp --- a/src/wallet/walletutil.cpp +++ b/src/wallet/walletutil.cpp @@ -71,7 +71,7 @@ // Found a directory which contains wallet.dat btree file, add it as // a wallet. paths.emplace_back(path); - } else if (it.level() == 0 && + } else if (it.depth() == 0 && it->symlink_status().type() == fs::regular_file && IsBerkeleyBtree(it->path())) { if (it->path().filename() == "wallet.dat") {