@@ -52,23 +52,6 @@ bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
52
52
return (txout.nValue < GetDustThreshold (txout, dustRelayFeeIn));
53
53
}
54
54
55
- /* *
56
- * Check transaction inputs to mitigate two
57
- * potential denial-of-service attacks:
58
- *
59
- * 1. scriptSigs with extra data stuffed into them,
60
- * not consumed by scriptPubKey (or P2SH script)
61
- * 2. P2SH scripts with a crazy number of expensive
62
- * CHECKSIG/CHECKMULTISIG operations
63
- *
64
- * Why bother? To avoid denial-of-service attacks; an attacker
65
- * can submit a standard HASH... OP_EQUAL transaction,
66
- * which will get accepted into blocks. The redemption
67
- * script can be anything; an attacker could use a very
68
- * expensive-to-check-upon-redemption script like:
69
- * DUP CHECKSIG DROP ... repeated 100 times... OP_1
70
- */
71
-
72
55
bool IsStandard (const CScript& scriptPubKey, txnouttype& whichType, const bool witnessEnabled)
73
56
{
74
57
std::vector<std::vector<unsigned char > > vSolutions;
@@ -158,6 +141,22 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
158
141
return true ;
159
142
}
160
143
144
+ /* *
145
+ * Check transaction inputs to mitigate two
146
+ * potential denial-of-service attacks:
147
+ *
148
+ * 1. scriptSigs with extra data stuffed into them,
149
+ * not consumed by scriptPubKey (or P2SH script)
150
+ * 2. P2SH scripts with a crazy number of expensive
151
+ * CHECKSIG/CHECKMULTISIG operations
152
+ *
153
+ * Why bother? To avoid denial-of-service attacks; an attacker
154
+ * can submit a standard HASH... OP_EQUAL transaction,
155
+ * which will get accepted into blocks. The redemption
156
+ * script can be anything; an attacker could use a very
157
+ * expensive-to-check-upon-redemption script like:
158
+ * DUP CHECKSIG DROP ... repeated 100 times... OP_1
159
+ */
161
160
bool AreInputsStandard (const CTransaction& tx, const CCoinsViewCache& mapInputs)
162
161
{
163
162
if (tx.IsCoinBase ())
0 commit comments