Bitcoin ABC 0.30.5
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
12static const uint64_t ONE_MEGABYTE = 1000000;
14static const uint64_t MAX_TX_SIZE = ONE_MEGABYTE;
16static const uint64_t MIN_TX_SIZE = 100;
18static const uint64_t LEGACY_MAX_BLOCK_SIZE = ONE_MEGABYTE;
20static const uint64_t DEFAULT_MAX_BLOCK_SIZE = 32 * ONE_MEGABYTE;
22static const uint64_t MAX_TX_SIGCHECKS = 3000;
27static const int BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO = 141;
32static const int COINBASE_MATURITY = 100;
34static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100;
35
38static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE = (1 << 0);
39
47inline uint64_t GetMaxBlockSigChecksCount(uint64_t maxBlockSize) {
48 return maxBlockSize / BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO;
49}
50
51#endif // BITCOIN_CONSENSUS_CONSENSUS_H
static const int MAX_COINBASE_SCRIPTSIG_SIZE
Coinbase scripts have their own script size limit.
Definition: consensus.h:34
static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE
Flags for nSequence and nLockTime locks.
Definition: consensus.h:38
static const uint64_t MAX_TX_SIZE
The maximum allowed size for a transaction, in bytes.
Definition: consensus.h:14
static const uint64_t LEGACY_MAX_BLOCK_SIZE
The maximum allowed size for a block, before the UAHF.
Definition: consensus.h:18
static const uint64_t ONE_MEGABYTE
1MB
Definition: consensus.h:12
static const uint64_t MIN_TX_SIZE
The minimum allowed size for a transaction, in bytes.
Definition: consensus.h:16
static const uint64_t DEFAULT_MAX_BLOCK_SIZE
Default setting for maximum allowed size for a block, in bytes.
Definition: consensus.h:20
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:47
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule).
Definition: consensus.h:32
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
static const uint64_t MAX_TX_SIGCHECKS
Allowed number of signature check operations per transaction.
Definition: consensus.h:22