MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetAuthCookie

Function GetAuthCookie

src/rpc/request.cpp:148–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148AuthCookieResult GetAuthCookie(std::string& cookie_out)
149{
150 std::ifstream file;
151 fs::path filepath = GetAuthCookieFile();
152 if (filepath.empty()) {
153 return AuthCookieResult::Disabled; // -norpccookiefile
154 }
155 file.open(filepath.std_path());
156 if (!file.is_open()) {
157 return AuthCookieResult::Error;
158 }
159 std::getline(file, cookie_out);
160 file.close();
161 return AuthCookieResult::Ok;
162}
163
164void DeleteAuthCookie()
165{

Callers 1

CallRPCFunction · 0.85

Calls 4

GetAuthCookieFileFunction · 0.85
emptyMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected