From e2469876613d3e2a98b0765570bef16328e2748f Mon Sep 17 00:00:00 2001 From: MASM fan Date: Fri, 7 Nov 2014 23:59:21 +0400 Subject: [PATCH 1/1] Define basic variables with const modifier --- src/kernel.h | 2 +- src/main.h | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/kernel.h b/src/kernel.h index 6491cfd..0fd9407 100644 --- a/src/kernel.h +++ b/src/kernel.h @@ -11,7 +11,7 @@ extern unsigned int nModifierUpgradeTime; // MODIFIER_INTERVAL: time to elapse before new modifier is computed -extern unsigned int nModifierInterval; +extern const unsigned int nModifierInterval; extern bool fCoinsDataActual; diff --git a/src/main.h b/src/main.h index 103c13a..e2661d9 100644 --- a/src/main.h +++ b/src/main.h @@ -32,12 +32,12 @@ class CNode; // // Global state // -static unsigned int nStakeMinAge = 60 * 60 * 24 * 30; // 30 days as zero time weight -static unsigned int nStakeMaxAge = 60 * 60 * 24 * 90; // 90 days as full weight -static unsigned int nStakeTargetSpacing = 10 * 60; // 10-minute stakes spacing -static unsigned int nModifierInterval = 6 * 60 * 60; // time to elapse before new modifier is computed +static const unsigned int nStakeMinAge = 60 * 60 * 24 * 30; // 30 days as zero time weight +static const unsigned int nStakeMaxAge = 60 * 60 * 24 * 90; // 90 days as full weight +static const unsigned int nStakeTargetSpacing = 10 * 60; // 10-minute stakes spacing +static const unsigned int nModifierInterval = 6 * 60 * 60; // time to elapse before new modifier is computed -static int nCoinbaseMaturity = 500; +static const int nCoinbaseMaturity = 500; static const unsigned int MAX_BLOCK_SIZE = 1000000; @@ -77,9 +77,7 @@ extern CCriticalSection cs_main; extern std::map mapBlockIndex; extern std::set > setStakeSeen; extern CBlockIndex* pindexGenesisBlock; -extern unsigned int nStakeMinAge; extern unsigned int nNodeLifespan; -extern int nCoinbaseMaturity; extern int nBestHeight; extern uint256 nBestChainTrust; extern uint256 nBestInvalidTrust; -- 1.7.1