Skip to content

Commit 52ede28

Browse files
committed
doc: Update comments for AreInputsStandard to match code
1 parent 770d39a commit 52ede28

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/policy/policy.cpp

+11-13
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,18 @@ bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_dat
169169
}
170170

171171
/**
172-
* Check transaction inputs to mitigate two
173-
* potential denial-of-service attacks:
172+
* Check transaction inputs.
174173
*
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.
186184
*
187185
* Note that only the non-witness portion of the transaction is checked here.
188186
*/

0 commit comments

Comments
 (0)