From 35842db70dd07966c4fcdb550e9815803373240e Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 7 Oct 2021 18:51:07 +0000 Subject: [PATCH] Allow disabling "non-standard" checks on mainnet --- src/init.cpp | 2 +- src/node/mempool_args.cpp | 3 --- test/functional/feature_config_args.py | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 42331d37e8..52872eee2f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -587,7 +587,7 @@ void SetupServerArgs(ArgsManager& argsman) SetupChainParamsBaseOptions(argsman); - argsman.AddArg("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (test networks only; default: %u)", DEFAULT_ACCEPT_NON_STD_TXN), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY); + argsman.AddArg("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (default: %u)", DEFAULT_ACCEPT_NON_STD_TXN), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY); argsman.AddArg("-incrementalrelayfee=", strprintf("Fee rate (in %s/kvB) used to define cost of relay, used for mempool limiting and replacement policy. (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY); argsman.AddArg("-dustrelayfee=", strprintf("Fee rate (in %s/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY); argsman.AddArg("-acceptstalefeeestimates", strprintf("Read fee estimates even if they are stale (%sdefault: %u) fee estimates are considered stale if they are %s hours old", "regtest only; ", DEFAULT_ACCEPT_STALE_FEE_ESTIMATES, Ticks(MAX_FILE_AGE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); diff --git a/src/node/mempool_args.cpp b/src/node/mempool_args.cpp index f63d9875fc..ba5da4e58b 100644 --- a/src/node/mempool_args.cpp +++ b/src/node/mempool_args.cpp @@ -87,9 +87,6 @@ util::Result ApplyArgsManOptions(const ArgsManager& argsman, const CChainP } mempool_opts.require_standard = !argsman.GetBoolArg("-acceptnonstdtxn", DEFAULT_ACCEPT_NON_STD_TXN); - if (!chainparams.IsTestChain() && !mempool_opts.require_standard) { - return util::Error{strprintf(Untranslated("acceptnonstdtxn is not currently supported for %s chain"), chainparams.GetChainTypeString())}; - } mempool_opts.full_rbf = argsman.GetBoolArg("-mempoolfullrbf", mempool_opts.full_rbf); diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py index dcea662089..aff0d836fc 100755 --- a/test/functional/feature_config_args.py +++ b/test/functional/feature_config_args.py @@ -77,9 +77,6 @@ class ConfArgsTest(BitcoinTestFramework): main_conf_file_path = self.nodes[0].datadir_path / "bitcoin_main.conf" util.write_config(main_conf_file_path, n=0, chain='', extra_config=f'includeconf={inc_conf_file_path}\n') - with open(inc_conf_file_path, 'w', encoding='utf-8') as conf: - conf.write('acceptnonstdtxn=1\n') - self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={main_conf_file_path}", "-allowignoredconf"], expected_msg='Error: acceptnonstdtxn is not currently supported for main chain') with open(inc_conf_file_path, 'w', encoding='utf-8') as conf: conf.write('nono\n')