Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

policy.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_POLICY_POLICY_H
7 #define BITCOIN_POLICY_POLICY_H
8 
9 #include <consensus/consensus.h>
10 #include <policy/feerate.h>
11 #include <script/interpreter.h>
12 #include <script/standard.h>
13 
14 #include <string>
15 
16 class CCoinsViewCache;
17 class CTxOut;
18 
20 static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 2000000;
22 static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;
24 static const unsigned int MAX_STANDARD_TX_SIZE = 100000;
26 static const unsigned int MAX_P2SH_SIGOPS = 15;
28 static const unsigned int MAX_STANDARD_TX_SIGOPS = 4000;
30 static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300;
32 static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 1000;
38 static const unsigned int DUST_RELAY_TX_FEE = 3000;
55 
58 
62 
64 
65 bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee);
66 
67 bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType);
72 bool IsStandardTx(const CTransaction& tx, std::string& reason);
78 bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs);
79 
81 extern CFeeRate dustRelayFee;
82 #endif // BITCOIN_POLICY_POLICY_H
static const unsigned int MAX_STANDARD_TX_SIGOPS
The maximum number of sigops we&#39;re willing to relay/mine in a single tx.
Definition: policy.h:28
static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE
Flags for nSequence and nLockTime locks.
Definition: consensus.h:28
CFeeRate incrementalRelayFee
Definition: policy.cpp:176
CScript scriptPubKey
Definition: transaction.h:148
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS
Used as the flags parameter to sequence and nLocktime checks in non-consensus code.
Definition: policy.h:60
static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE
Default for -maxmempool, maximum megabytes of mempool memory usage.
Definition: policy.h:30
static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE
Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or BIP...
Definition: policy.h:32
bool IsStandardTx(const CTransaction &tx, std::string &reason)
Check for standard transaction types.
Definition: policy.cpp:62
CAmount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFee)
Definition: policy.cpp:17
CFeeRate dustRelayFee
Definition: policy.cpp:177
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFee)
Definition: policy.cpp:35
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
static const unsigned int MAX_P2SH_SIGOPS
Maximum number of signature check operations in an IsStandard() P2SH script.
Definition: policy.h:26
static constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST
Use GetMedianTimePast() instead of nTime for end point timestamp.
Definition: consensus.h:30
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE
Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by min...
Definition: policy.h:22
static const unsigned int DEFAULT_BLOCK_MAX_SIZE
Default for -blockmaxsize, which controls the maximum size of block the mining code will create...
Definition: policy.h:20
An output of a transaction.
Definition: transaction.h:144
txnouttype
Definition: standard.h:56
static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS
Standard script verification flags that standard transactions will comply with.
Definition: policy.h:44
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:389
static const unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
Definition: policy.h:38
Fee rate in satoshis per kilobyte: CAmount / kB.
Definition: feerate.h:19
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Definition: coins.h:201
bool IsStandard(const CScript &scriptPubKey, txnouttype &whichType)
Definition: policy.cpp:40
static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS
Mandatory script verification flags that all new blocks must comply with for them to be valid...
Definition: standard.h:54
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check for standard transaction types.
Definition: policy.cpp:142
static const unsigned int MAX_STANDARD_TX_SIZE
The maximum size for transactions we&#39;re willing to relay/mine.
Definition: policy.h:24
static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS
For convenience, standard but not mandatory verify flags.
Definition: policy.h:57
Released under the MIT license