mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Use GetPathArg where possible
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
@@ -135,7 +135,7 @@ static const char* BITCOIN_PID_FILENAME = "bitcoind.pid";
|
||||
|
||||
static fs::path GetPidFile(const ArgsManager& args)
|
||||
{
|
||||
return AbsPathForConfigVal(fs::PathFromString(args.GetArg("-pid", BITCOIN_PID_FILENAME)));
|
||||
return AbsPathForConfigVal(args.GetPathArg("-pid", BITCOIN_PID_FILENAME));
|
||||
}
|
||||
|
||||
[[nodiscard]] static bool CreatePidFile(const ArgsManager& args)
|
||||
@@ -1229,10 +1229,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
// Read asmap file if configured
|
||||
std::vector<bool> asmap;
|
||||
if (args.IsArgSet("-asmap")) {
|
||||
fs::path asmap_path = fs::PathFromString(args.GetArg("-asmap", ""));
|
||||
if (asmap_path.empty()) {
|
||||
asmap_path = fs::PathFromString(DEFAULT_ASMAP_FILENAME);
|
||||
}
|
||||
fs::path asmap_path = args.GetPathArg("-asmap", DEFAULT_ASMAP_FILENAME);
|
||||
if (!asmap_path.is_absolute()) {
|
||||
asmap_path = gArgs.GetDataDirNet() / asmap_path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user