diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index fdb6bc5f341..3da6cb7489b 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -98,7 +98,7 @@ bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType) bool IsStandardTx(const CTransaction& tx, const std::optional& max_datacarrier_bytes, bool permit_bare_multisig, const CFeeRate& dust_relay_fee, std::string& reason) { - if (tx.version > TX_MAX_STANDARD_VERSION || tx.version < 1) { + if (tx.version > TX_MAX_STANDARD_VERSION || tx.version < TX_MIN_STANDARD_VERSION) { reason = "version"; return false; } diff --git a/src/policy/policy.h b/src/policy/policy.h index ce8bfc6aef9..23993dd705e 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -145,6 +145,7 @@ std::vector GetDust(const CTransaction& tx, CFeeRate dust_relay_rate); // Changing the default transaction version requires a two step process: first // adapting relay policy by bumping TX_MAX_STANDARD_VERSION, and then later // allowing the new transaction version in the wallet/RPC. +static constexpr decltype(CTransaction::version) TX_MIN_STANDARD_VERSION{1}; static constexpr decltype(CTransaction::version) TX_MAX_STANDARD_VERSION{3}; /**