@@ -11,24 +11,24 @@ bool CheckTransaction(const CTransaction& tx, TxValidationState& state)
11
11
{
12
12
// Basic checks that don't depend on any context
13
13
if (tx.vin .empty ())
14
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-vin-empty" );
14
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-vin-empty" );
15
15
if (tx.vout .empty ())
16
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-vout-empty" );
16
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-vout-empty" );
17
17
// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
18
18
if (::GetSerializeSize (tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
19
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-oversize" );
19
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-oversize" );
20
20
21
21
// Check for negative or overflow output values (see CVE-2010-5139)
22
22
CAmount nValueOut = 0 ;
23
23
for (const auto & txout : tx.vout )
24
24
{
25
25
if (txout.nValue < 0 )
26
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-vout-negative" );
26
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-vout-negative" );
27
27
if (txout.nValue > MAX_MONEY)
28
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-vout-toolarge" );
28
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-vout-toolarge" );
29
29
nValueOut += txout.nValue ;
30
30
if (!MoneyRange (nValueOut))
31
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-txouttotal-toolarge" );
31
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-txouttotal-toolarge" );
32
32
}
33
33
34
34
// Check for duplicate inputs (see CVE-2018-17144)
@@ -39,19 +39,19 @@ bool CheckTransaction(const CTransaction& tx, TxValidationState& state)
39
39
std::set<COutPoint> vInOutPoints;
40
40
for (const auto & txin : tx.vin ) {
41
41
if (!vInOutPoints.insert (txin.prevout ).second )
42
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-inputs-duplicate" );
42
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-inputs-duplicate" );
43
43
}
44
44
45
45
if (tx.IsCoinBase ())
46
46
{
47
47
if (tx.vin [0 ].scriptSig .size () < 2 || tx.vin [0 ].scriptSig .size () > 100 )
48
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-cb-length" );
48
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-cb-length" );
49
49
}
50
50
else
51
51
{
52
52
for (const auto & txin : tx.vin )
53
53
if (txin.prevout .IsNull ())
54
- return state.Invalid (TxValidationResult::TX_CONSENSUS, false , " bad-txns-prevout-null" );
54
+ return state.Invalid (TxValidationResult::TX_CONSENSUS, " bad-txns-prevout-null" );
55
55
}
56
56
57
57
return true ;
0 commit comments