diff options
author | fanquake <fanquake@gmail.com> | 2022-08-04 16:52:06 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-08-04 16:58:01 +0100 |
commit | e09ad284c762a79d59417389e9056c18e25d9770 (patch) | |
tree | cff41566298ca0b13dad1b1c7074801e873e72cb /src/rpc/request.cpp | |
parent | 36c83b40bd68a993ab6459cb0d5d2c8ce4541147 (diff) | |
parent | b01f336708019f8c8274ea701d3446e4123e7af2 (diff) |
Merge bitcoin/bitcoin#24675: util: Use ArgsManager::GetPathArg more widely
b01f336708019f8c8274ea701d3446e4123e7af2 util, refactor: Drop explicit conversion to fs::path (Hennadii Stepanov)
138c668e2b4d64279ddefbe07c1d9b7c3d3c537c util, refactor: Use GetPathArg to read "-rpccookiefile" value (Hennadii Stepanov)
1276090705060fcc97072481c2383bbaaa556194 util, refactor: Use GetPathArg to read "-conf" value (Hennadii Stepanov)
Pull request description:
This PR is a continuation of bitcoin/bitcoin#24265 and bitcoin/bitcoin#24306.
Now the following command-line arguments / configure options been read with the `GetPathArg` method:
- `-conf`, also `includeconf` values been normalized
- `-rpccookiefile`
ACKs for top commit:
jarolrod:
Code Review ACK b01f336708019f8c8274ea701d3446e4123e7af2
ryanofsky:
Code review ACK b01f336708019f8c8274ea701d3446e4123e7af. Changes since last review: just dropping first commit (NormalizedPathFromString) as suggested
Tree-SHA512: 2d26d50b73542acdbcc63a32068977b2a49a017d31ca337471a0446f964eb0a6e3e4e3bb1ebe6771566a260f2cae3bc2ebe93b4b523183cea0d51768daab85c9
Diffstat (limited to 'src/rpc/request.cpp')
-rw-r--r-- | src/rpc/request.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/request.cpp b/src/rpc/request.cpp index 304c265b31..8595fa78bb 100644 --- a/src/rpc/request.cpp +++ b/src/rpc/request.cpp @@ -66,16 +66,16 @@ UniValue JSONRPCError(int code, const std::string& message) */ static const std::string COOKIEAUTH_USER = "__cookie__"; /** Default name for auth cookie file */ -static const std::string COOKIEAUTH_FILE = ".cookie"; +static const char* const COOKIEAUTH_FILE = ".cookie"; /** Get name of RPC authentication cookie file */ static fs::path GetAuthCookieFile(bool temp=false) { - std::string arg = gArgs.GetArg("-rpccookiefile", COOKIEAUTH_FILE); + fs::path arg = gArgs.GetPathArg("-rpccookiefile", COOKIEAUTH_FILE); if (temp) { arg += ".tmp"; } - return AbsPathForConfigVal(fs::PathFromString(arg)); + return AbsPathForConfigVal(arg); } bool GenerateAuthCookie(std::string *cookie_out) |