diff --git a/src/rpc/protocol.cpp b/src/rpc/protocol.cpp index 089e8162b8..338718b7f4 100644 --- a/src/rpc/protocol.cpp +++ b/src/rpc/protocol.cpp @@ -68,6 +68,7 @@ UniValue JSONRPCError(int code, const string& message) static const std::string COOKIEAUTH_USER = "__cookie__"; /** Default name for auth cookie file */ static const std::string COOKIEAUTH_FILE = ".cookie"; +static const std::string MAINCHAIN_COOKIEAUTH_FILE = "regtest/.cookie"; boost::filesystem::path GetAuthCookieFile() { @@ -78,8 +79,7 @@ boost::filesystem::path GetAuthCookieFile() boost::filesystem::path GetMainchainAuthCookieFile() { - boost::filesystem::path path(GetArg("-mainchainrpccookiefile", COOKIEAUTH_FILE)); - if (!path.is_complete() && BaseParams().DataDir() == CHAINPARAMS_REGTEST) path = "regtest" / path; + boost::filesystem::path path(GetArg("-mainchainrpccookiefile", MAINCHAIN_COOKIEAUTH_FILE)); if (!path.is_complete()) path = GetDataDir(false) / path; return path; }