From 424a85fcddb714dc7da19b69d44b505461360dea Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 7 Dec 2016 10:37:03 -0500 Subject: [PATCH] Detect mainchain cookie auth using datadir checking, not mapArgs --- src/rpc/protocol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/protocol.cpp b/src/rpc/protocol.cpp index bed2688418..976f4db6ce 100644 --- a/src/rpc/protocol.cpp +++ b/src/rpc/protocol.cpp @@ -11,6 +11,7 @@ #include "utilstrencodings.h" #include "utiltime.h" #include "version.h" +#include "chainparamsbase.h" #include #include @@ -78,9 +79,8 @@ boost::filesystem::path GetAuthCookieFile() boost::filesystem::path GetMainchainAuthCookieFile() { boost::filesystem::path path(GetArg("-mainchainrpccookiefile", COOKIEAUTH_FILE)); - //Change to default false for live network - if (!path.is_complete() && GetBoolArg("-testnet", true)) path = "testnet3" / path; - if (!path.is_complete() && GetBoolArg("-regtest", false)) path = "regtest" / path; + if (!path.is_complete() && BaseParams().DataDir() == CHAINPARAMS_ELEMENTS) path = "testnet3" / path; + if (!path.is_complete() && BaseParams().DataDir() == CHAINPARAMS_REGTEST) path = "regtest" / path; if (!path.is_complete()) path = GetDataDir(false) / path; return path; }