@@ -169,20 +169,18 @@ bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_dat
169
169
}
170
170
171
171
/* *
172
- * Check transaction inputs to mitigate two
173
- * potential denial-of-service attacks:
172
+ * Check transaction inputs.
174
173
*
175
- * 1. scriptSigs with extra data stuffed into them,
176
- * not consumed by scriptPubKey (or P2SH script)
177
- * 2. P2SH scripts with a crazy number of expensive
178
- * CHECKSIG/CHECKMULTISIG operations
179
- *
180
- * Why bother? To avoid denial-of-service attacks; an attacker
181
- * can submit a standard HASH... OP_EQUAL transaction,
182
- * which will get accepted into blocks. The redemption
183
- * script can be anything; an attacker could use a very
184
- * expensive-to-check-upon-redemption script like:
185
- * DUP CHECKSIG DROP ... repeated 100 times... OP_1
174
+ * This does three things:
175
+ * * Prevents mempool acceptance of spends of future
176
+ * segwit versions we don't know how to validate
177
+ * * Mitigates a potential denial-of-service attack with
178
+ * P2SH scripts with a crazy number of expensive
179
+ * CHECKSIG/CHECKMULTISIG operations.
180
+ * * Prevents spends of unknown/irregular scriptPubKeys,
181
+ * which mitigates potential denial-of-service attacks
182
+ * involving expensive scripts and helps reserve them
183
+ * as potential new upgrade hooks.
186
184
*
187
185
* Note that only the non-witness portion of the transaction is checked here.
188
186
*/
0 commit comments