diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-21 18:36:20 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-08-02 15:28:30 +0200 |
commit | fad0b4fab849eb5f1f0aa54ebc290f85a473ec91 (patch) | |
tree | 26fb06e68fce525fca1bab4a855ae22453b35271 /src/policy | |
parent | fa2a6b8516b24d7e9ca11926a49cf2b07f661e81 (diff) |
Pass datacarrier setting into IsStandard
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/policy.cpp | 6 | ||||
-rw-r--r-- | src/policy/policy.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 0a79c0a1d8..fc890bff38 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -67,7 +67,7 @@ bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFeeIn) return (txout.nValue < GetDustThreshold(txout, dustRelayFeeIn)); } -bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType) +bool IsStandard(const CScript& scriptPubKey, const std::optional<unsigned>& max_datacarrier_bytes, TxoutType& whichType) { std::vector<std::vector<unsigned char> > vSolutions; whichType = Solver(scriptPubKey, vSolutions); @@ -83,7 +83,7 @@ bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType) if (m < 1 || m > n) return false; } else if (whichType == TxoutType::NULL_DATA) { - if (!g_max_datacarrier_bytes || scriptPubKey.size() > *g_max_datacarrier_bytes) { + if (!max_datacarrier_bytes || scriptPubKey.size() > *max_datacarrier_bytes) { return false; } } @@ -131,7 +131,7 @@ bool IsStandardTx(const CTransaction& tx, bool permit_bare_multisig, const CFeeR unsigned int nDataOut = 0; TxoutType whichType; for (const CTxOut& txout : tx.vout) { - if (!::IsStandard(txout.scriptPubKey, whichType)) { + if (!::IsStandard(txout.scriptPubKey, g_max_datacarrier_bytes, whichType)) { reason = "scriptpubkey"; return false; } diff --git a/src/policy/policy.h b/src/policy/policy.h index 15a66efa0d..e3734003ce 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -105,7 +105,7 @@ CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee); bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee); -bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType); +bool IsStandard(const CScript& scriptPubKey, const std::optional<unsigned>& max_datacarrier_bytes, TxoutType& whichType); // Changing the default transaction version requires a two step process: first |