Skip to content

Commit

Permalink
Merge pull request dogecoin#3558 from patricklodder/compat/boost185
Browse files Browse the repository at this point in the history
compat: fix compatibility with boost 1.85
  • Loading branch information
chromatic authored Jul 18, 2024
2 parents f78c49a + d021d75 commit 6cfd452
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rpc/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static const std::string COOKIEAUTH_FILE = ".cookie";
fs::path GetAuthCookieFile()
{
fs::path path(GetArg("-rpccookiefile", COOKIEAUTH_FILE));
if (!path.is_complete()) path = GetDataDir() / path;
if (!path.is_absolute()) path = GetDataDir() / path;
return path;
}

Expand Down
4 changes: 2 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ const fs::path &GetBackupDir()
fs::path GetConfigFile(const std::string& confPath)
{
fs::path pathConfigFile(confPath);
if (!pathConfigFile.is_complete())
if (!pathConfigFile.is_absolute())
pathConfigFile = GetDataDir(false) / pathConfigFile;

return pathConfigFile;
Expand Down Expand Up @@ -624,7 +624,7 @@ void ReadConfigFile(const std::string& confPath)
fs::path GetPidFile()
{
fs::path pathPidFile(GetArg("-pid", BITCOIN_PID_FILENAME));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
if (!pathPidFile.is_absolute()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}

Expand Down
1 change: 1 addition & 0 deletions src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <algorithm>
#include <exception>
#include <list>
#include <map>
#include <set>
#include <stdint.h>
Expand Down
10 changes: 8 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,10 @@ bool CWallet::Verify()
uiInterface.InitMessage(_("Verifying wallet..."));

// Wallet file must be a plain filename without a directory
if (walletFile != fs::basename(walletFile) + fs::extension(walletFile))
fs::path walletPath(walletFile);
if (walletFile != walletPath.stem().string() + walletPath.extension().string()) {
return InitError(strprintf(_("Wallet %s resides outside data directory %s"), walletFile, GetDataDir().string()));
}

if (!bitdb.Open(GetDataDir()))
{
Expand Down Expand Up @@ -4019,7 +4021,11 @@ bool CWallet::BackupWallet(const std::string& strDest)
return false;
}

#if BOOST_VERSION >= 104000
#if BOOST_VERSION >= 107400
// Boost 1.74.0 and up implements std++17 like "copy_options", and this
// is the only remaining enum after 1.85.0
fs::copy_file(pathSrc, pathDest, fs::copy_options::overwrite_existing);
#elif BOOST_VERSION >= 104000
fs::copy_file(pathSrc, pathDest, fs::copy_option::overwrite_if_exists);
#else
fs::copy_file(pathSrc, pathDest);
Expand Down

0 comments on commit 6cfd452

Please sign in to comment.