diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-09-06 18:12:50 -0700 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-09-06 18:12:53 -0700 |
commit | 2a56baf395bf11835d784c4f8634f4525deed6a1 (patch) | |
tree | 2b23273d487e43f08e7e5ecfd0edd498eda57cf5 /src | |
parent | f65614726de21e116966366d6abdf025dfeb6db2 (diff) | |
parent | ca67ddf0b737b65fb2909b65ab15ecc000aca06a (diff) |
Merge #10682: Trivial: Move the AreInputsStandard documentation next to its implementation
ca67ddf0b Move the AreInputsStandard documentation next to its implementation (esneider)
Pull request description:
The documentation (and rationale) for `AreInputsStandard` somehow got separated from its implementation, and creates a bit of confusion: it's in the middle of the file, next to the implementation of `IsStandard`, which actually checks the "standardness" of outputs, not inputs.
Tree-SHA512: 71281cbcbc5a5701cc11e812a3e90669dda3d92dc2176b512b7832d79b08b34307999c984516bb0c56b01db9b03a12ee4755f662efc1158f4e126de5ca421999
Diffstat (limited to 'src')
-rw-r--r-- | src/policy/policy.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 605e3e0696..56912d0375 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -54,23 +54,6 @@ bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFeeIn) return (txout.nValue < GetDustThreshold(txout, dustRelayFeeIn)); } - /** - * Check transaction inputs to mitigate two - * potential denial-of-service attacks: - * - * 1. scriptSigs with extra data stuffed into them, - * not consumed by scriptPubKey (or P2SH script) - * 2. P2SH scripts with a crazy number of expensive - * CHECKSIG/CHECKMULTISIG operations - * - * Why bother? To avoid denial-of-service attacks; an attacker - * can submit a standard HASH... OP_EQUAL transaction, - * which will get accepted into blocks. The redemption - * script can be anything; an attacker could use a very - * expensive-to-check-upon-redemption script like: - * DUP CHECKSIG DROP ... repeated 100 times... OP_1 - */ - bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType, const bool witnessEnabled) { std::vector<std::vector<unsigned char> > vSolutions; @@ -160,6 +143,22 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes return true; } +/** + * Check transaction inputs to mitigate two + * potential denial-of-service attacks: + * + * 1. scriptSigs with extra data stuffed into them, + * not consumed by scriptPubKey (or P2SH script) + * 2. P2SH scripts with a crazy number of expensive + * CHECKSIG/CHECKMULTISIG operations + * + * Why bother? To avoid denial-of-service attacks; an attacker + * can submit a standard HASH... OP_EQUAL transaction, + * which will get accepted into blocks. The redemption + * script can be anything; an attacker could use a very + * expensive-to-check-upon-redemption script like: + * DUP CHECKSIG DROP ... repeated 100 times... OP_1 + */ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) { if (tx.IsCoinBase()) |