![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include "consensus/consensus.h"
#include "script/interpreter.h"
#include "script/standard.h"
#include <string>
Go to the source code of this file.
Functions | |
bool | IsStandard (const CScript &scriptPubKey, txnouttype &whichType) |
bool | IsStandardTx (const CTransaction &tx, std::string &reason) |
bool | AreInputsStandard (const CTransaction &tx, const CCoinsViewCache &mapInputs) |
Variables | |
static const unsigned int | DEFAULT_BLOCK_MAX_SIZE = 750000 |
static const unsigned int | DEFAULT_BLOCK_MIN_SIZE = 0 |
static const unsigned int | DEFAULT_BLOCK_PRIORITY_SIZE = 10000 |
static const unsigned int | MAX_STANDARD_TX_SIZE = 100000 |
static const unsigned int | MAX_P2SH_SIGOPS = 15 |
static const unsigned int | MAX_STANDARD_TX_SIGOPS = 4000 |
static const unsigned int | DEFAULT_MAX_MEMPOOL_SIZE = 300 |
static const unsigned int | STANDARD_SCRIPT_VERIFY_FLAGS |
static const unsigned int | STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS |
static const unsigned int | STANDARD_LOCKTIME_VERIFY_FLAGS |
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 |
Definition at line 123 of file policy.cpp.
Referenced by AcceptToMemoryPoolWorker().
bool IsStandard | ( | const CScript & | scriptPubKey, |
txnouttype & | whichType | ||
) |
Check transaction inputs to mitigate two potential denial-of-service attacks:
Check transaction inputs, and make sure any pay-to-script-hash transactions are evaluating IsStandard scripts
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 37 of file policy.cpp.
Referenced by IsStandardTx().
bool IsStandardTx | ( | const CTransaction & | tx, |
std::string & | reason | ||
) |
Check for standard transaction types
Definition at line 59 of file policy.cpp.
Referenced by AcceptToMemoryPoolWorker().
|
static |
Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create
Definition at line 18 of file policy.h.
Referenced by CreateNewBlock(), and HelpMessage().
|
static |
Definition at line 19 of file policy.h.
Referenced by CreateNewBlock(), and HelpMessage().
|
static |
Default for -blockprioritysize, maximum space for zero/low-fee transactions
Definition at line 21 of file policy.h.
Referenced by CreateNewBlock(), and HelpMessage().
|
static |
Default for -maxmempool, maximum megabytes of mempool memory usage
Definition at line 29 of file policy.h.
Referenced by AcceptToMemoryPoolWorker(), ActivateBestChainStep(), AppInit2(), CBlockPolicyEstimator::estimateSmartFee(), CBlockPolicyEstimator::estimateSmartPriority(), HelpMessage(), InvalidateBlock(), and mempoolInfoToJSON().
|
static |
Maximum number of signature check operations in an IsStandard() P2SH script
Definition at line 25 of file policy.h.
Referenced by AreInputsStandard().
|
static |
The maximum number of sigops we're willing to relay/mine in a single tx
Definition at line 27 of file policy.h.
Referenced by AcceptToMemoryPoolWorker().
|
static |
The maximum size for transactions we're willing to relay/mine
Definition at line 23 of file policy.h.
Referenced by ContextualCheckBlock(), ContextualCheckTransaction(), CWallet::CreateTransaction(), and IsStandardTx().
|
static |
Used as the flags parameter to sequence and nLocktime checks in non-consensus code.
Definition at line 50 of file policy.h.
Referenced by AcceptToMemoryPoolWorker(), ActivateBestChainStep(), CreateNewBlock(), and InvalidateBlock().
|
static |
For convenience, standard but not mandatory verify flags.
Definition at line 47 of file policy.h.
Referenced by CheckInputs().
|
static |
Standard script verification flags that standard transactions will comply with. However scripts violating these flags may still be present in valid blocks and we must accept those blocks.
Definition at line 35 of file policy.h.
Referenced by AcceptToMemoryPoolWorker(), MutateTxSign(), ProduceSignature(), and signrawtransaction().