aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/tx_check.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2023-09-07 19:16:57 +1000
committerAnthony Towns <aj@erisian.com.au>2023-11-14 08:45:30 +1000
commit6e9e4e6130797b721c8df1eabaf46ec25ebb6abe (patch)
tree6444c337cd23d1e6aabedf229a9efb1583fb7351 /src/consensus/tx_check.cpp
parent5800c558eb5efb4839ed00d6967e43306d68e1c3 (diff)
Use ParamsWrapper for witness serialization
Diffstat (limited to 'src/consensus/tx_check.cpp')
-rw-r--r--src/consensus/tx_check.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/consensus/tx_check.cpp b/src/consensus/tx_check.cpp
index f949655909..b3fee1e8b1 100644
--- a/src/consensus/tx_check.cpp
+++ b/src/consensus/tx_check.cpp
@@ -16,8 +16,9 @@ bool CheckTransaction(const CTransaction& tx, TxValidationState& state)
if (tx.vout.empty())
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vout-empty");
// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
- if (::GetSerializeSize(tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
+ if (::GetSerializeSize(TX_NO_WITNESS(tx)) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT) {
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-oversize");
+ }
// Check for negative or overflow output values (see CVE-2010-5139)
CAmount nValueOut = 0;