MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetMainchainAuthCookieFile

Function GetMainchainAuthCookieFile

src/rpc/request.cpp:138–149  ·  view source on GitHub ↗

Get name mainchain RPC authentication cookie file */

Source from the content-addressed store, hash-verified

136static const std::string MAINCHAIN_COOKIEAUTH_FILE = "regtest/.cookie";
137/** Get name mainchain RPC authentication cookie file */
138static fs::path GetMainchainAuthCookieFile()
139{
140 std::string cookie_file = MAINCHAIN_COOKIEAUTH_FILE;
141 // Bitcoin mainnet exception
142 if (gArgs.GetChainName() == "liquidv1") {
143 cookie_file = ".cookie";
144 }
145 fs::path cookie_path = fs::PathFromString(gArgs.GetArg("-mainchainrpccookiefile", cookie_file));
146 if (cookie_path.is_absolute())
147 return cookie_path;
148 return fsbridge::AbsPathJoin(GetMainchainDefaultDataDir(), cookie_path);
149}
150
151bool GetMainchainAuthCookie(std::string *cookie_out)
152{

Callers 1

GetMainchainAuthCookieFunction · 0.85

Calls 5

PathFromStringFunction · 0.85
AbsPathJoinFunction · 0.85
GetChainNameMethod · 0.80
GetArgMethod · 0.80

Tested by

no test coverage detected