mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-22 21:50:14 +01:00
Replace fs::absolute calls with AbsPathJoin calls
This adds better test coverage and will make it easier in #20744 to remove our dependency on the two-argument boost::filesystem::absolute() function which does not have a direct equivalent in C++17.
This commit is contained in:
@@ -2399,10 +2399,10 @@ static RPCHelpMan dumptxoutset()
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
fs::path path = fs::absolute(request.params[0].get_str(), GetDataDir());
|
||||
const fs::path path = fsbridge::AbsPathJoin(GetDataDir(), request.params[0].get_str());
|
||||
// Write to a temporary path and then move into `path` on completion
|
||||
// to avoid confusion due to an interruption.
|
||||
fs::path temppath = fs::absolute(request.params[0].get_str() + ".incomplete", GetDataDir());
|
||||
const fs::path temppath = fsbridge::AbsPathJoin(GetDataDir(), request.params[0].get_str() + ".incomplete");
|
||||
|
||||
if (fs::exists(path)) {
|
||||
throw JSONRPCError(
|
||||
|
||||
Reference in New Issue
Block a user