From acdbd44af1807b5114e6edd480680395478a2f38 Mon Sep 17 00:00:00 2001 From: alexhz Date: Mon, 24 Nov 2014 13:22:57 +0000 Subject: [PATCH] Move basic variables back to main.cpp. --- src/kernel.cpp | 4 +++- src/kernel.h | 2 +- src/main.cpp | 6 ++++++ src/main.h | 9 ++------- src/wallet.h | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/kernel.cpp b/src/kernel.cpp index 19a391e..58b427c 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -6,7 +6,9 @@ #include "kernel.h" #include "txdb.h" -#include "main.h" + +extern unsigned int nStakeMaxAge; +extern unsigned int nStakeTargetSpacing; using namespace std; diff --git a/src/kernel.h b/src/kernel.h index 5cfa946..e39c728 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 const unsigned int nModifierInterval; +extern unsigned int nModifierInterval; extern bool fCoinsDataActual; diff --git a/src/main.cpp b/src/main.cpp index 1271c1a..8de5f6a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,6 +42,12 @@ uint256 nPoWBase = uint256("0x00000000ffff00000000000000000000000000000000000000 CBigNum bnProofOfWorkLimitTestNet(~uint256(0) >> 16); +unsigned int nStakeMinAge = 60 * 60 * 24 * 30; // 30 days as zero time weight +unsigned int nStakeMaxAge = 60 * 60 * 24 * 90; // 90 days as full weight +unsigned int nStakeTargetSpacing = 10 * 60; // 10-minute stakes spacing +unsigned int nModifierInterval = 6 * 60 * 60; // time to elapse before new modifier is computed + +int nCoinbaseMaturity = 500; CBlockIndex* pindexGenesisBlock = NULL; int nBestHeight = -1; diff --git a/src/main.h b/src/main.h index e2661d9..95da601 100644 --- a/src/main.h +++ b/src/main.h @@ -32,13 +32,6 @@ class CNode; // // Global state // -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 const int nCoinbaseMaturity = 500; - static const unsigned int MAX_BLOCK_SIZE = 1000000; static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2; @@ -78,6 +71,8 @@ extern std::map mapBlockIndex; extern std::set > setStakeSeen; extern CBlockIndex* pindexGenesisBlock; extern unsigned int nNodeLifespan; +extern unsigned int nStakeMinAge; +extern int nCoinbaseMaturity; extern int nBestHeight; extern uint256 nBestChainTrust; extern uint256 nBestInvalidTrust; diff --git a/src/wallet.h b/src/wallet.h index c1b8f1a..adaa305 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -18,6 +18,7 @@ #include "util.h" #include "walletdb.h" +extern unsigned int nStakeMaxAge; extern bool fWalletUnlockMintOnly; extern bool fConfChange; class CAccountingEntry; -- 1.7.1