aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-01-20 13:04:39 +0800
committerfanquake <fanquake@gmail.com>2022-01-20 13:06:04 +0800
commita541e5d5198893c3af0d2d1164a15082fb87e006 (patch)
treea1bd2d279faae8bd1aa91668f3cbf2fc1128e52b /src
parent7102f7d6f3c4a3d08e22ae34a0b3460503a919cf (diff)
parentdc5d6b0d4793ca978f71f69ef7d6b818794676c2 (diff)
Merge bitcoin/bitcoin#24104: fs: Make compatible with boost 1.78
dc5d6b0d4793ca978f71f69ef7d6b818794676c2 fs: Make compatible with boost 1.78 (Andrew Chow) Pull request description: Boost 1.78 removed `operator+` in a way that breaks our usage of it in a subclass. A [proposed workaround](https://github.com/boostorg/filesystem/issues/223#issuecomment-1000230207) for this is to cast the argument to `boost::filesystem::path`, and this is backwards compatible with older versions of boost. Additionally, it appears that `fs::canonical` no longer removes trailing slashes. This was causing a test to fail. The solution is to explicitly remove the trailing separator in the one place that `fs::canonical` is used. Lastly, `fs::create_directories` now has an error message saying `create_directories` instead of `create_directory`. This caused wallet_multiwallet.py to fail. The error message check has been updated to be able accept either string. Fixes #23846 ACKs for top commit: ryanofsky: Code review ACK dc5d6b0d4793ca978f71f69ef7d6b818794676c2 vincenzopalazzo: ACK https://github.com/bitcoin/bitcoin/pull/24104/commits/dc5d6b0d4793ca978f71f69ef7d6b818794676c2 Tree-SHA512: d4d8e7b49b8dfbf0ced9bfe9a2b3827841227fc755fc799f19159076b0ccf882432cc8b6ad93cdeda98fb58b942b9ba50a9e0a6b4f6b1e0097e80f1074ae5682
Diffstat (limited to 'src')
-rw-r--r--src/fs.h2
-rw-r--r--src/wallet/load.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/fs.h b/src/fs.h
index 9f18794539..bc36636084 100644
--- a/src/fs.h
+++ b/src/fs.h
@@ -88,7 +88,7 @@ static inline auto quoted(const std::string& s)
// Allow safe path append operations.
static inline path operator+(path p1, path p2)
{
- p1 += std::move(p2);
+ p1 += static_cast<boost::filesystem::path&&>(p2);
return p1;
}
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp
index 2d47673705..e6f96074d5 100644
--- a/src/wallet/load.cpp
+++ b/src/wallet/load.cpp
@@ -29,7 +29,7 @@ bool VerifyWallets(WalletContext& context)
fs::path wallet_dir = fs::PathFromString(args.GetArg("-walletdir", ""));
boost::system::error_code error;
// The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
- fs::path canonical_wallet_dir = fs::canonical(wallet_dir, error);
+ fs::path canonical_wallet_dir = fs::canonical(wallet_dir, error).remove_trailing_separator();
if (error || !fs::exists(wallet_dir)) {
chain.initError(strprintf(_("Specified -walletdir \"%s\" does not exist"), fs::PathToString(wallet_dir)));
return false;