diff options
-rw-r--r-- | src/init.cpp | 1 | ||||
-rw-r--r-- | src/kernel/mempool_options.h | 1 | ||||
-rw-r--r-- | src/mempool_args.cpp | 3 | ||||
-rw-r--r-- | src/policy/settings.cpp | 1 | ||||
-rw-r--r-- | src/policy/settings.h | 1 | ||||
-rw-r--r-- | src/txmempool.cpp | 1 | ||||
-rw-r--r-- | src/txmempool.h | 1 | ||||
-rw-r--r-- | src/validation.cpp | 2 |
8 files changed, 7 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index a0e2b7fcfd..49c7de7816 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -975,7 +975,6 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb if (!g_wallet_init_interface.ParameterInteraction()) return false; - fIsBareMultisigStd = args.GetBoolArg("-permitbaremultisig", DEFAULT_PERMIT_BAREMULTISIG); fAcceptDatacarrier = args.GetBoolArg("-datacarrier", DEFAULT_ACCEPT_DATACARRIER); nMaxDatacarrierBytes = args.GetIntArg("-datacarriersize", nMaxDatacarrierBytes); diff --git a/src/kernel/mempool_options.h b/src/kernel/mempool_options.h index 384532ae39..197a018ba3 100644 --- a/src/kernel/mempool_options.h +++ b/src/kernel/mempool_options.h @@ -40,6 +40,7 @@ struct MemPoolOptions { /** A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) */ CFeeRate min_relay_feerate{DEFAULT_MIN_RELAY_TX_FEE}; CFeeRate dust_relay_feerate{DUST_RELAY_TX_FEE}; + bool permit_bare_multisig{DEFAULT_PERMIT_BAREMULTISIG}; bool require_standard{true}; bool full_rbf{DEFAULT_MEMPOOL_FULL_RBF}; MemPoolLimits limits{}; diff --git a/src/mempool_args.cpp b/src/mempool_args.cpp index 745d7b0316..463ad77869 100644 --- a/src/mempool_args.cpp +++ b/src/mempool_args.cpp @@ -11,6 +11,7 @@ #include <consensus/amount.h> #include <logging.h> #include <policy/feerate.h> +#include <policy/policy.h> #include <tinyformat.h> #include <util/error.h> #include <util/moneystr.h> @@ -77,6 +78,8 @@ std::optional<bilingual_str> ApplyArgsManOptions(const ArgsManager& argsman, con } } + mempool_opts.permit_bare_multisig = argsman.GetBoolArg("-permitbaremultisig", DEFAULT_PERMIT_BAREMULTISIG); + mempool_opts.require_standard = !argsman.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard()); if (!chainparams.IsTestChain() && !mempool_opts.require_standard) { return strprintf(Untranslated("acceptnonstdtxn is not currently supported for %s chain"), chainparams.NetworkIDString()); diff --git a/src/policy/settings.cpp b/src/policy/settings.cpp index 6b15d31d68..39e00f1111 100644 --- a/src/policy/settings.cpp +++ b/src/policy/settings.cpp @@ -7,5 +7,4 @@ #include <policy/policy.h> -bool fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG; unsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP; diff --git a/src/policy/settings.h b/src/policy/settings.h index df0bfff394..22af063b4c 100644 --- a/src/policy/settings.h +++ b/src/policy/settings.h @@ -13,7 +13,6 @@ class CTransaction; extern unsigned int nBytesPerSigOp; -extern bool fIsBareMultisigStd; static inline int64_t GetVirtualTransactionSize(int64_t weight, int64_t sigop_cost) { diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 4745b99620..4af4ca0851 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -461,6 +461,7 @@ CTxMemPool::CTxMemPool(const Options& opts) m_incremental_relay_feerate{opts.incremental_relay_feerate}, m_min_relay_feerate{opts.min_relay_feerate}, m_dust_relay_feerate{opts.dust_relay_feerate}, + m_permit_bare_multisig{opts.permit_bare_multisig}, m_require_standard{opts.require_standard}, m_full_rbf{opts.full_rbf}, m_limits{opts.limits} diff --git a/src/txmempool.h b/src/txmempool.h index 84e5e9ed48..32c404d0dd 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -571,6 +571,7 @@ public: const CFeeRate m_incremental_relay_feerate; const CFeeRate m_min_relay_feerate; const CFeeRate m_dust_relay_feerate; + const bool m_permit_bare_multisig; const bool m_require_standard; const bool m_full_rbf; diff --git a/src/validation.cpp b/src/validation.cpp index 22913b763b..c22b96d56f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -700,7 +700,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // Rather not work on nonstandard transactions (unless -testnet/-regtest) std::string reason; - if (m_pool.m_require_standard && !IsStandardTx(tx, ::fIsBareMultisigStd, m_pool.m_dust_relay_feerate, reason)) { + if (m_pool.m_require_standard && !IsStandardTx(tx, m_pool.m_permit_bare_multisig, m_pool.m_dust_relay_feerate, reason)) { return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason); } |