Skip to content

Commit 3d9362d

Browse files
committed
Merge pull request #6398
85ee55b rpc: Remove chain-specific RequireRPCPassword (Wladimir J. van der Laan)
2 parents 44fa82d + 85ee55b commit 3d9362d

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

src/chainparams.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class CMainParams : public CChainParams {
9898

9999
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
100100

101-
fRequireRPCPassword = true;
102101
fMiningRequiresPeers = true;
103102
fDefaultConsistencyChecks = false;
104103
fRequireStandard = true;
@@ -169,7 +168,6 @@ class CTestNetParams : public CMainParams {
169168

170169
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
171170

172-
fRequireRPCPassword = true;
173171
fMiningRequiresPeers = true;
174172
fDefaultConsistencyChecks = false;
175173
fRequireStandard = false;
@@ -215,7 +213,6 @@ class CRegTestParams : public CTestNetParams {
215213
vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
216214
vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds.
217215

218-
fRequireRPCPassword = false;
219216
fMiningRequiresPeers = false;
220217
fDefaultConsistencyChecks = true;
221218
fRequireStandard = false;

src/chainparams.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class CChainParams
5151
int GetDefaultPort() const { return nDefaultPort; }
5252

5353
const CBlock& GenesisBlock() const { return genesis; }
54-
bool RequireRPCPassword() const { return fRequireRPCPassword; }
5554
/** Make miner wait to have peers to avoid wasting work */
5655
bool MiningRequiresPeers() const { return fMiningRequiresPeers; }
5756
/** Default value for -checkmempool and -checkblockindex argument */
@@ -83,7 +82,6 @@ class CChainParams
8382
std::string strNetworkID;
8483
CBlock genesis;
8584
std::vector<SeedSpec6> vFixedSeeds;
86-
bool fRequireRPCPassword;
8785
bool fMiningRequiresPeers;
8886
bool fDefaultConsistencyChecks;
8987
bool fRequireStandard;

src/rpcserver.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,7 @@ void StartRPCThreads()
598598
LogPrint("rpc", "Allowing RPC connections from: %s\n", strAllowed);
599599

600600
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
601-
if (((mapArgs["-rpcpassword"] == "") ||
602-
(mapArgs["-rpcuser"] == mapArgs["-rpcpassword"])) && Params().RequireRPCPassword())
601+
if (mapArgs["-rpcpassword"] == "")
603602
{
604603
unsigned char rand_pwd[32];
605604
GetRandBytes(rand_pwd, 32);

0 commit comments

Comments
 (0)