![]() |
BSHA3
0.17.99
P2P Blockchain, based on Bitcoin
|
#include <consensus/consensus.h>#include <policy/feerate.h>#include <script/interpreter.h>#include <script/standard.h>#include <string>Go to the source code of this file.
Functions | |
| CAmount | GetDustThreshold (const CTxOut &txout, const CFeeRate &dustRelayFee) |
| bool | IsDust (const CTxOut &txout, const CFeeRate &dustRelayFee) |
| bool | IsStandard (const CScript &scriptPubKey, txnouttype &whichType) |
| bool | IsStandardTx (const CTransaction &tx, std::string &reason) |
| Check for standard transaction types. More... | |
| bool | AreInputsStandard (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
| Check for standard transaction types. More... | |
| bool | IsWitnessStandard (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
| Check if the transaction is over standard P2WSH resources limit: 3600bytes witnessScript size, 80bytes per witness stack element, 100 witness stack elements These limits are adequate for multi-signature up to n-of-100 using OP_CHECKSIG, OP_ADD, and OP_EQUAL,. More... | |
| int64_t | GetVirtualTransactionSize (int64_t nWeight, int64_t nSigOpCost) |
| Compute the virtual transaction size (weight reinterpreted as bytes). More... | |
| int64_t | GetVirtualTransactionSize (const CTransaction &tx, int64_t nSigOpCost=0) |
| int64_t | GetVirtualTransactionInputSize (const CTxIn &tx, int64_t nSigOpCost=0) |
Variables | |
| CFeeRate | incrementalRelayFee |
| CFeeRate | dustRelayFee |
| unsigned int | nBytesPerSigOp |
| bool AreInputsStandard | ( | const CTransaction & | tx, |
| const CCoinsViewCache & | mapInputs | ||
| ) |
Check for standard transaction types.
| [in] | mapInputs | Map of previous transactions that have outputs we're spending |
Check for standard transaction types.
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
Definition at line 160 of file policy.cpp.
Definition at line 18 of file policy.cpp.
| int64_t GetVirtualTransactionInputSize | ( | const CTxIn & | tx, |
| int64_t | nSigOpCost = 0 |
||
| ) |
Definition at line 256 of file policy.cpp.
| int64_t GetVirtualTransactionSize | ( | int64_t | nWeight, |
| int64_t | nSigOpCost | ||
| ) |
Compute the virtual transaction size (weight reinterpreted as bytes).
Definition at line 246 of file policy.cpp.
| int64_t GetVirtualTransactionSize | ( | const CTransaction & | tx, |
| int64_t | nSigOpCost = 0 |
||
| ) |
Definition at line 52 of file policy.cpp.
| bool IsStandard | ( | const CScript & | scriptPubKey, |
| txnouttype & | whichType | ||
| ) |
| bool IsStandardTx | ( | const CTransaction & | tx, |
| std::string & | reason | ||
| ) |
Check for standard transaction types.
Definition at line 80 of file policy.cpp.
| bool IsWitnessStandard | ( | const CTransaction & | tx, |
| const CCoinsViewCache & | mapInputs | ||
| ) |
Check if the transaction is over standard P2WSH resources limit: 3600bytes witnessScript size, 80bytes per witness stack element, 100 witness stack elements These limits are adequate for multi-signature up to n-of-100 using OP_CHECKSIG, OP_ADD, and OP_EQUAL,.
Definition at line 190 of file policy.cpp.
| CFeeRate dustRelayFee |
Definition at line 243 of file policy.cpp.
| CFeeRate incrementalRelayFee |
Definition at line 242 of file policy.cpp.
| unsigned int nBytesPerSigOp |
Definition at line 244 of file policy.cpp.
1.8.14