mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-24 12:51:39 +02:00
rpc: Add transaction min standard version parameter
This commit is contained in:
@@ -98,7 +98,7 @@ bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType)
|
|||||||
|
|
||||||
bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_datacarrier_bytes, bool permit_bare_multisig, const CFeeRate& dust_relay_fee, std::string& reason)
|
bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& 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";
|
reason = "version";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -145,6 +145,7 @@ std::vector<uint32_t> GetDust(const CTransaction& tx, CFeeRate dust_relay_rate);
|
|||||||
// Changing the default transaction version requires a two step process: first
|
// Changing the default transaction version requires a two step process: first
|
||||||
// adapting relay policy by bumping TX_MAX_STANDARD_VERSION, and then later
|
// adapting relay policy by bumping TX_MAX_STANDARD_VERSION, and then later
|
||||||
// allowing the new transaction version in the wallet/RPC.
|
// 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};
|
static constexpr decltype(CTransaction::version) TX_MAX_STANDARD_VERSION{3};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user