Bitcoin ABC  0.24.7
P2P Digital Currency
consensus.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_CONSENSUS_CONSENSUS_H
7 #define BITCOIN_CONSENSUS_CONSENSUS_H
8 
9 #include <cstdint>
10 
12 static const uint64_t ONE_MEGABYTE = 1000000;
14 static const uint64_t MAX_TX_SIZE = ONE_MEGABYTE;
16 static const uint64_t MIN_TX_SIZE = 100;
18 static const uint64_t LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE;
20 static const uint64_t DEFAULT_MAX_BLOCK_SIZE = 32 * ONE_MEGABYTE;
22 static const uint64_t MAX_TX_SIGCHECKS = 3000;
27 static const int BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO = 141;
32 static const int COINBASE_MATURITY = 100;
34 static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100;
35 
38 static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE = (1 << 0);
40 static constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST = (1 << 1);
41 
49 inline uint64_t GetMaxBlockSigChecksCount(uint64_t maxBlockSize) {
50  return maxBlockSize / BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO;
51 }
52 
53 #endif // BITCOIN_CONSENSUS_CONSENSUS_H
COINBASE_MATURITY
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule).
Definition: consensus.h:32
GetMaxBlockSigChecksCount
uint64_t GetMaxBlockSigChecksCount(uint64_t maxBlockSize)
Compute the maximum number of sigchecks that can be contained in a block given the MAXIMUM block size...
Definition: consensus.h:49
MAX_TX_SIGCHECKS
static const uint64_t MAX_TX_SIGCHECKS
Allowed number of signature check operations per transaction.
Definition: consensus.h:22
LOCKTIME_MEDIAN_TIME_PAST
static constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST
Use GetMedianTimePast() instead of nTime for end point timestamp.
Definition: consensus.h:40
MAX_COINBASE_SCRIPTSIG_SIZE
static const int MAX_COINBASE_SCRIPTSIG_SIZE
Coinbase scripts have their own script size limit.
Definition: consensus.h:34
LOCKTIME_VERIFY_SEQUENCE
static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE
Flags for nSequence and nLockTime locks.
Definition: consensus.h:38
MAX_TX_SIZE
static const uint64_t MAX_TX_SIZE
The maximum allowed size for a transaction, in bytes.
Definition: consensus.h:14
MIN_TX_SIZE
static const uint64_t MIN_TX_SIZE
The minimum allowed size for a transaction, in bytes.
Definition: consensus.h:16
DEFAULT_MAX_BLOCK_SIZE
static const uint64_t DEFAULT_MAX_BLOCK_SIZE
Default setting for maximum allowed size for a block, in bytes.
Definition: consensus.h:20
ONE_MEGABYTE
static const uint64_t ONE_MEGABYTE
1MB
Definition: consensus.h:12
LEGACY_MAX_BLOCK_SIZE
static const uint64_t LEGACY_MAX_BLOCK_SIZE
The maximum allowed size for a block, before the UAHF.
Definition: consensus.h:18
BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO
static const int BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO
The ratio between the maximum allowable block size and the maximum allowable SigChecks (executed sign...
Definition: consensus.h:27