<commit_before>// Copyright (c) 2009-2010 <NAME>
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
#define BITCOIN_MAIN_H

#include <algorithm>

#ifndef BITCOIN_TIMESTAMPS_H
 #include "timestamps.h"
#endif

#ifndef BITCOIN_BIGNUM_H
 #include "bignum.h"
#endif

#ifndef BITCOIN_SYNC_H
 #include "sync.h"
#endif

#ifndef BITCOIN_NET_H
 #include "net.h"
#endif

#ifndef H_BITCOIN_SCRIPT
 #include "script.h"
#endif

#ifndef SCRYPT_H
 #include "scrypt.h"
#endif

#include <list>
#include <map>

class CWallet;
class CBlock;
class CBlockIndex;
class CKeyItem;
class CReserveKey;
class COutPoint;

class CAddress;
class CInv;
class CRequestTracker;
class CNode;

//
// Global state
//
#if defined(Yac1dot0)
       const ::uint32_t Nfactor_1dot0 = 17;
#endif
extern int 
    nStatisticsNumberOfBlocks2000,
    nStatisticsNumberOfBlocks1000,
    nStatisticsNumberOfBlocks200,
    nStatisticsNumberOfBlocks100,
    nStatisticsNumberOfBlocks;

static const unsigned int MAX_GENESIS_BLOCK_SIZE = 1000000;
static const unsigned int MAX_ORPHAN_TRANSACTIONS = 10000;
static const unsigned int DEFAULT_MAX_BLOCK_SIGOPS = 20000;
static const unsigned int MAX_INV_SZ = 50000;

static const ::int64_t MIN_TX_FEE = CENT;
static const ::int64_t MIN_RELAY_TX_FEE = MIN_TX_FEE;

static const ::int64_t MAX_MONEY = 2000000000 * COIN;
static const ::int64_t MAX_MINT_PROOF_OF_WORK = 100 * COIN;
static const ::int64_t MAX_MINT_PROOF_OF_STAKE = 1 * COIN;
static const ::int64_t MIN_TXOUT_AMOUNT = CENT/100;

static const unsigned char MAXIMUM_N_FACTOR = 25;  //30; since uint32_t fails on 07 Feb 2106 06:28:15 GMT
                                                   //    when stored as an uint32_t in a block
                                                   //    so there is no point going past Nf = 25

static const unsigned char YAC20_N_FACTOR = 16;

// block version header
static const int
    VERSION_of_block_for_yac_05x_new = 7,
    VERSION_of_block_for_yac_049     = 6,
    VERSION_of_block_for_yac_044_old = 3,
    CURRENT_VERSION_of_block = VERSION_of_block_for_yac_049;

//static const int
//    CURRENT_VERSION_previous = VERSION_of_block_for_yac_044_old;

inline bool MoneyRange(::int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov  5 00:53:20 1985 UTC
// Maximum number of script-checking threads allowed
static const int MAX_SCRIPTCHECK_THREADS = 16;

static const uint256 
    // hashGenesisBlock("0x0000060fc90618113cde415ead019a1052a9abc43afcccff38608ff8751353e5");
    // hashGenesisBlock("0x00000f3f5eac1539c4e9216e17c74ff387ac1629884d2f97a3144dc32bf67bda");
    // hashGenesisBlock("0x0ea17bb85e10d8c6ded6783a4ce8f79e75d49b439ff41f55d274e6b15612fff9");
    hashGenesisBlock("0x0000060fc90618113cde415ead019a1052a9abc43afcccff38608ff8751353e5");
extern const uint256 
    nPoWeasiestTargetLimitTestNet,
    hashGenesisBlockTestNet;
extern int 
    nConsecutiveStakeSwitchHeight;  // see timesamps.h = 420000;

const ::int64_t 
#ifdef Yac1dot0
    nMaxClockDrift = 12 * nSecondsPerMinute;
#else
    nMaxClockDrift = nTwoHoursInSeconds;
#endif
inline ::int64_t PastDrift(::int64_t nTime)   
    { return nTime - nMaxClockDrift; } // up to 2 hours from the past
inline ::int64_t FutureDrift(::int64_t nTime) 
    { return nTime + nMaxClockDrift; } // up to 2 hours from the future

extern const ::int64_t 
    nChainStartTime,
    nChainStartTimeTestNet;
extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main;
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
extern std::set<std::pair<COutPoint, unsigned int> > setStakeSeen;
extern CBlockIndex* pindexGenesisBlock;
extern unsigned int nNodeLifespan;
//extern unsigned int nStakeMinAge;
extern int nCoinbaseMaturity;
extern int nBestHeight;
extern CBigNum bnBestChainTrust;
extern CBigNum bnBestInvalidTrust;
extern uint256 hashBestChain;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
extern ::uint64_t nLastBlockTx;<commit_msg>Keep nMaxClockDrift same as 0.4.9<commit_after>// Copyright (c) 2009-2010 <NAME>
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
#define BITCOIN_MAIN_H

#include <algorithm>

#ifndef BITCOIN_TIMESTAMPS_H
 #include "timestamps.h"
#endif

#ifndef BITCOIN_BIGNUM_H
 #include "bignum.h"
#endif

#ifndef BITCOIN_SYNC_H
 #include "sync.h"
#endif

#ifndef BITCOIN_NET_H
 #include "net.h"
#endif

#ifndef H_BITCOIN_SCRIPT
 #include "script.h"
#endif

#ifndef SCRYPT_H
 #include "scrypt.h"
#endif

#include <list>
#include <map>

class CWallet;
class CBlock;
class CBlockIndex;
class CKeyItem;
class CReserveKey;
class COutPoint;

class CAddress;
class CInv;
class CRequestTracker;
class CNode;

//
// Global state
//
#if defined(Yac1dot0)
       const ::uint32_t Nfactor_1dot0 = 17;
#endif
extern int 
    nStatisticsNumberOfBlocks2000,
    nStatisticsNumberOfBlocks1000,
    nStatisticsNumberOfBlocks200,
    nStatisticsNumberOfBlocks100,
    nStatisticsNumberOfBlocks;

static const unsigned int MAX_GENESIS_BLOCK_SIZE = 1000000;
static const unsigned int MAX_ORPHAN_TRANSACTIONS = 10000;
static const unsigned int DEFAULT_MAX_BLOCK_SIGOPS = 20000;
static const unsigned int MAX_INV_SZ = 50000;

static const ::int64_t MIN_TX_FEE = CENT;
static const ::int64_t MIN_RELAY_TX_FEE = MIN_TX_FEE;

static const ::int64_t MAX_MONEY = 2000000000 * COIN;
static const ::int64_t MAX_MINT_PROOF_OF_WORK = 100 * COIN;
static const ::int64_t MAX_MINT_PROOF_OF_STAKE = 1 * COIN;
static const ::int64_t MIN_TXOUT_AMOUNT = CENT/100;

static const unsigned char MAXIMUM_N_FACTOR = 25;  //30; since uint32_t fails on 07 Feb 2106 06:28:15 GMT
                                                   //    when stored as an uint32_t in a block
                                                   //    so there is no point going past Nf = 25

static const unsigned char YAC20_N_FACTOR = 16;

// block version header
static const int
    VERSION_of_block_for_yac_05x_new = 7,
    VERSION_of_block_for_yac_049     = 6,
    VERSION_of_block_for_yac_044_old = 3,
    CURRENT_VERSION_of_block = VERSION_of_block_for_yac_049;

//static const int
//    CURRENT_VERSION_previous = VERSION_of_block_for_yac_044_old;

inline bool MoneyRange(::int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov  5 00:53:20 1985 UTC
// Maximum number of script-checking threads allowed
static const int MAX_SCRIPTCHECK_THREADS = 16;

static const uint256 
    // hashGenesisBlock("0x0000060fc90618113cde415ead019a1052a9abc43afcccff38608ff8751353e5");
    // hashGenesisBlock("0x00000f3f5eac1539c4e9216e17c74ff387ac1629884d2f97a3144dc32bf67bda");
    // hashGenesisBlock("0x0ea17bb85e10d8c6ded6783a4ce8f79e75d49b439ff41f55d274e6b15612fff9");
    hashGenesisBlock("0x0000060fc90618113cde415ead019a1052a9abc43afcccff38608ff8751353e5");
extern const uint256 
    nPoWeasiestTargetLimitTestNet,
    hashGenesisBlockTestNet;
extern int 
    nConsecutiveStakeSwitchHeight;  // see timesamps.h = 420000;

const ::int64_t 
    nMaxClockDrift = nTwoHoursInSeconds;

inline ::int64_t PastDrift(::int64_t nTime)   
    { return nTime - nMaxClockDrift; } // up to 2 hours from the past
inline ::int64_t FutureDrift(::int64_t nTime) 
    { return nTime + nMaxClockDrift; } // up to 2 hours from the future

extern const ::int64_t 
    nChainStartTime,
    nChainStartTimeTestNet;
extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main;
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
extern std::set<std::pair<COutPoint, unsigned int> > setStakeSeen;
extern CBlockIndex* pindexGenesisBlock;
extern unsigned int nNodeLifespan;
//extern unsigned int nStakeMinAge;
extern int nCoinbaseMaturity;
extern int nBestHeight;
extern CBigNum bnBestChainTrust;
extern CBigNum bnBestInvalidTrust;
extern uint256 hashBestChain;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
extern ::uint64_t nLastBlockTx;
{'fraction_non_alphanumeric': 0.0730012951842694, 'fraction_numerical': 0.08512892970681737, 'mean_word_length': 4.651363938789088, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3649652', 'n_tokens_mistral': 3513, 'n_tokens_neox': 2963, 'n_words': 748}