diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 6cee379faf9..7e69c097a6a 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -152,7 +152,6 @@ class CMainParams : public CChainParams { vFixedSeeds = std::vector(std::begin(chainparams_seed_main), std::end(chainparams_seed_main)); fDefaultConsistencyChecks = false; - m_is_test_chain = false; m_is_mockable_chain = false; checkpointData = { @@ -259,7 +258,6 @@ class CTestNetParams : public CChainParams { vFixedSeeds = std::vector(std::begin(chainparams_seed_test), std::end(chainparams_seed_test)); fDefaultConsistencyChecks = false; - m_is_test_chain = true; m_is_mockable_chain = false; checkpointData = { @@ -381,7 +379,6 @@ class SigNetParams : public CChainParams { bech32_hrp = "tb"; fDefaultConsistencyChecks = false; - m_is_test_chain = true; m_is_mockable_chain = false; } }; @@ -472,7 +469,6 @@ class CRegTestParams : public CChainParams vSeeds.emplace_back("dummySeed.invalid."); fDefaultConsistencyChecks = true; - m_is_test_chain = true; m_is_mockable_chain = true; checkpointData = { diff --git a/src/kernel/chainparams.h b/src/kernel/chainparams.h index 63837bb23ed..ec1697493c9 100644 --- a/src/kernel/chainparams.h +++ b/src/kernel/chainparams.h @@ -93,7 +93,7 @@ class CChainParams /** Default value for -checkmempool and -checkblockindex argument */ bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; } /** If this chain is exclusively used for testing */ - bool IsTestChain() const { return m_is_test_chain; } + bool IsTestChain() const { return m_chain_type != ChainType::MAIN; } /** If this chain allows time to be mocked */ bool IsMockableChain() const { return m_is_mockable_chain; } uint64_t PruneAfterHeight() const { return nPruneAfterHeight; } @@ -167,7 +167,6 @@ class CChainParams CBlock genesis; std::vector vFixedSeeds; bool fDefaultConsistencyChecks; - bool m_is_test_chain; bool m_is_mockable_chain; CCheckpointData checkpointData; MapAssumeutxo m_assumeutxo_data; diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index 377e9de0e84..705608bd476 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -862,7 +862,7 @@ static RPCHelpMan submitpackage() }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { - if (!Params().IsMockableChain()) { + if (Params().GetChainType() != ChainType::REGTEST) { throw std::runtime_error("submitpackage is for regression testing (-regtest mode) only"); } const UniValue raw_transactions = request.params[0].get_array();