![]() |
Raven Core
3.0.0
P2P Digital Currency
|
#include "policy/policy.h"#include "consensus/validation.h"#include "validation.h"#include "coins.h"#include "tinyformat.h"#include "util.h"#include "utilstrencodings.h"Go to the source code of this file.
Functions | |
| CAmount | GetDustThreshold (const CTxOut &txout, const CFeeRate &dustRelayFeeIn) |
| bool | IsDust (const CTxOut &txout, const CFeeRate &dustRelayFeeIn) |
| bool | IsStandard (const CScript &scriptPubKey, txnouttype &whichType, const bool witnessEnabled) |
| bool | IsStandardTx (const CTransaction &tx, std::string &reason, const bool witnessEnabled) |
| Check for standard transaction types. More... | |
| bool | AreInputsStandard (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
| Check transaction inputs to mitigate two potential denial-of-service attacks: 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) |
Variables | |
| CFeeRate | incrementalRelayFee = CFeeRate(DEFAULT_INCREMENTAL_RELAY_FEE) |
| CFeeRate | dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE) |
| unsigned int | nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP |
| bool AreInputsStandard | ( | const CTransaction & | tx, |
| const CCoinsViewCache & | mapInputs | ||
| ) |
Check transaction inputs to mitigate two potential denial-of-service attacks:
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 176 of file policy.cpp.
Definition at line 19 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 266 of file policy.cpp.
| int64_t GetVirtualTransactionSize | ( | const CTransaction & | tx, |
| int64_t | nSigOpCost | ||
| ) |
Definition at line 53 of file policy.cpp.
| bool IsStandard | ( | const CScript & | scriptPubKey, |
| txnouttype & | whichType, | ||
| const bool | witnessEnabled | ||
| ) |
| bool IsStandardTx | ( | const CTransaction & | tx, |
| std::string & | reason, | ||
| const bool | witnessEnabled = false |
||
| ) |
Check for standard transaction types.
Definition at line 87 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 210 of file policy.cpp.
Definition at line 263 of file policy.cpp.
Definition at line 262 of file policy.cpp.
| unsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP |
Definition at line 264 of file policy.cpp.
1.8.13