X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.h;h=240b12436e1d1d5e990b4f2c709e2f78de34556a;hb=18770118e846622f59a86f9937a33da0bb761775;hp=6a320ac0cc57b37790bcbfd86e20a1a9f3d3fa8f;hpb=07bc41cd07f81fffadcf5b0fb8838e84a159389e;p=novacoin.git diff --git a/src/main.h b/src/main.h index 6a320ac..240b124 100644 --- a/src/main.h +++ b/src/main.h @@ -5,6 +5,8 @@ #ifndef BITCOIN_MAIN_H #define BITCOIN_MAIN_H +#include + #include "timestamps.h" #include "bignum.h" #include "sync.h" @@ -27,6 +29,17 @@ class CInv; class CRequestTracker; 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 int nCoinbaseMaturity = 500; + + static const unsigned int MAX_BLOCK_SIZE = 1000000; static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2; static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; @@ -614,7 +627,7 @@ public: filein >> *this; } catch (std::exception &e) { - return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION); } // Return file pointer @@ -700,13 +713,13 @@ public: @param[in] fBlock true if called from ConnectBlock @param[in] fMiner true if called from CreateNewBlock @param[in] fScriptChecks enable scripts validation? - @param[in] flags STANDARD_SCRIPT_VERIFY_FLAGS script validation flags + @param[in] flags STRICT_FLAGS script validation flags @param[in] pvChecks NULL If pvChecks is not NULL, script checks are pushed onto it instead of being performed inline. @return Returns true if all checks succeed */ bool ConnectInputs(CTxDB& txdb, MapPrevTx inputs, std::map& mapTestPool, const CDiskTxPos& posThisTx, const CBlockIndex* pindexBlock, bool fBlock, bool fMiner, bool fScriptChecks=true, - unsigned int flags=STANDARD_SCRIPT_VERIFY_FLAGS, std::vector *pvChecks = NULL); + unsigned int flags=STRICT_FLAGS, std::vector *pvChecks = NULL); bool ClientConnectInputs(); bool CheckTransaction() const; bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL); @@ -958,7 +971,8 @@ public: if (nTime >= ENTROPY_SWITCH_TIME || fTestNet) { // Take last bit of block hash as entropy bit - unsigned int nEntropyBit = ((GetHash().Get64()) & 1llu); + unsigned int nEntropyBit = ((GetHash().Get64()) & 1ULL); + //unsigned int nEntropyBit = 1; if (fDebug && GetBoolArg("-printstakemodifier")) printf("GetStakeEntropyBit: nTime=%u hashBlock=%s nEntropyBit=%u\n", nTime, GetHash().ToString().c_str(), nEntropyBit); return nEntropyBit; @@ -1091,7 +1105,7 @@ public: filein >> *this; } catch (std::exception &e) { - return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION); } // Check the header