Changeset View
Changeset View
Standalone View
Standalone View
src/consensus/consensus.h
Show All 30 Lines | |||||
*/ | */ | ||||
static const int COINBASE_MATURITY = 100; | static const int COINBASE_MATURITY = 100; | ||||
/** Coinbase scripts have their own script size limit. */ | /** Coinbase scripts have their own script size limit. */ | ||||
static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100; | static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100; | ||||
/** Activation time for P2SH (April 1st 2012) */ | /** Activation time for P2SH (April 1st 2012) */ | ||||
static const int64_t P2SH_ACTIVATION_TIME = 1333234914; | static const int64_t P2SH_ACTIVATION_TIME = 1333234914; | ||||
/** Flags for nSequence and nLockTime locks */ | /** Flags for nSequence and nLockTime locks */ | ||||
enum { | /** Interpret sequence numbers as relative lock-time constraints. */ | ||||
/* Interpret sequence numbers as relative lock-time constraints. */ | static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE = (1 << 0); | ||||
LOCKTIME_VERIFY_SEQUENCE = (1 << 0), | /** Use GetMedianTimePast() instead of nTime for end point timestamp. */ | ||||
static constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST = (1 << 1); | |||||
/* Use GetMedianTimePast() instead of nTime for end point timestamp. */ | |||||
LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), | |||||
}; | |||||
/** | /** | ||||
* Compute the maximum number of sigops operation that can contained in a block | * Compute the maximum number of sigops operation that can contained in a block | ||||
* given the block size as parameter. It is computed by multiplying | * given the block size as parameter. It is computed by multiplying | ||||
* MAX_BLOCK_SIGOPS_PER_MB by the size of the block in MB rounded up to the | * MAX_BLOCK_SIGOPS_PER_MB by the size of the block in MB rounded up to the | ||||
* closest integer. | * closest integer. | ||||
*/ | */ | ||||
inline uint64_t GetMaxBlockSigOpsCount(uint64_t blockSize) { | inline uint64_t GetMaxBlockSigOpsCount(uint64_t blockSize) { | ||||
auto nMbRoundedUp = 1 + ((blockSize - 1) / ONE_MEGABYTE); | auto nMbRoundedUp = 1 + ((blockSize - 1) / ONE_MEGABYTE); | ||||
return nMbRoundedUp * MAX_BLOCK_SIGOPS_PER_MB; | return nMbRoundedUp * MAX_BLOCK_SIGOPS_PER_MB; | ||||
} | } | ||||
#endif // BITCOIN_CONSENSUS_CONSENSUS_H | #endif // BITCOIN_CONSENSUS_CONSENSUS_H |