aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/tx_check.cpp
diff options
context:
space:
mode:
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;