MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / InitRPCAuthentication

Function InitRPCAuthentication

src/httprpc.cpp:214–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214static bool InitRPCAuthentication()
215{
216 if (gArgs.GetArg("-rpcpassword", "") == "")
217 {
218 LogPrintf("No rpcpassword set - using random cookie authentication.\n");
219 if (!GenerateAuthCookie(&strRPCUserColonPass)) {
220 uiInterface.ThreadSafeMessageBox(
221 _("Error: A fatal internal error occurred, see debug.log for details"), // Same message as AbortNode
222 "", CClientUIInterface::MSG_ERROR);
223 return false;
224 }
225 } else {
226 LogPrintf("Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcauth for rpcauth auth generation.\n");
227 strRPCUserColonPass = gArgs.GetArg("-rpcuser", "") + ":" + gArgs.GetArg("-rpcpassword", "");
228 }
229 if (gArgs.GetArg("-rpcauth","") != "")
230 {
231 LogPrintf("Using rpcauth authentication.\n");
232 }
233 return true;
234}
235
236bool StartHTTPRPC()
237{

Callers 1

StartHTTPRPCFunction · 0.85

Calls 3

GenerateAuthCookieFunction · 0.85
_Function · 0.85
GetArgMethod · 0.45

Tested by

no test coverage detected