Allow masternode mode and -listen=0 in regtest mode

This commit is contained in:
Alexander Block 2020-03-30 14:53:09 +02:00
parent bb63327623
commit 38bf1a31fb
2 changed files with 3 additions and 3 deletions

View File

@ -1459,7 +1459,7 @@ bool AppInitParameterInteraction()
}
if (gArgs.IsArgSet("-masternodeblsprivkey")) {
if (!gArgs.GetBoolArg("-listen", DEFAULT_LISTEN)) {
if (!gArgs.GetBoolArg("-listen", DEFAULT_LISTEN) && Params().NetworkIDString() != CBaseChainParams::REGTEST) {
return InitError("Masternode must accept connections from outside, set -listen=1");
}
if (!gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {

View File

@ -68,7 +68,7 @@ void CActiveMasternodeManager::Init(const CBlockIndex* pindex)
if (!deterministicMNManager->IsDIP3Enforced(pindex->nHeight)) return;
// Check that our local network configuration is correct
if (!fListen) {
if (!fListen && Params().NetworkIDString() != CBaseChainParams::REGTEST) {
// listen option is probably overwritten by something else, no good
state = MASTERNODE_ERROR;
strError = "Masternode must accept connections from outside. Make sure listen configuration option is not overwritten by some another parameter.";
@ -119,7 +119,7 @@ void CActiveMasternodeManager::Init(const CBlockIndex* pindex)
bool fConnected = ConnectSocketDirectly(activeMasternodeInfo.service, hSocket, nConnectTimeout) && IsSelectableSocket(hSocket);
CloseSocket(hSocket);
if (!fConnected) {
if (!fConnected && Params().NetworkIDString() != CBaseChainParams::REGTEST) {
state = MASTERNODE_ERROR;
strError = "Could not connect to " + activeMasternodeInfo.service.ToString();
LogPrintf("CActiveMasternodeManager::Init -- ERROR: %s\n", strError);