From a470c4e2510be7c232b4830e7701cebbdf3624a5 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 16 Jun 2020 12:21:30 -0400 Subject: [PATCH] get rid of z2zforkheight which causes linker bugz --- src/cc/cclib.cpp | 3 --- src/komodo_defs.h | 3 +-- src/main.cpp | 10 +++++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index e8b4a32b2..67440f3da 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -35,9 +35,6 @@ #define EVAL_ROGUE 17 std::string MYCCLIBNAME = (char *)"rogue"; -extern const uint32_t z2zForkHeight; - - #elif BUILD_CUSTOMCC #include "customcc.h" diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 3a4af6f48..e482390bb 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -59,10 +59,9 @@ const uint32_t nHushHardforkHeight2 = 245055; // No coins/code are currently using timestamp activated fork const uint32_t nHushHardforkTimestamp = 1580303652; // Jan 29nd 1pm GMT const uint32_t nHushHardforkTimestamp2 = 1594425600; // Jul 11th 12a GMT -extern const uint32_t z2zForkHeight; static const uint32_t KMD_SEASON_TIMESTAMPS[NUM_KMD_SEASONS] = {1525132800, 1563148800, nHushHardforkTimestamp, nHushHardforkTimestamp2, nHushHardforkTimestamp2*5, nHushHardforkTimestamp2*6}; -static const int32_t KMD_SEASON_HEIGHTS[NUM_KMD_SEASONS] = {1,2,nHushHardforkHeight, nHushHardforkHeight2, (int)z2zForkHeight, 5*nHushHardforkHeight2}; +static const int32_t KMD_SEASON_HEIGHTS[NUM_KMD_SEASONS] = {1,2,nHushHardforkHeight, nHushHardforkHeight2, (int)340000, 5*nHushHardforkHeight2}; // Era array of pubkeys. Add extra seasons to bottom as requried, after adding appropriate info above. static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = diff --git a/src/main.cpp b/src/main.cpp index d5afa5baf..f0bc7793a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,7 +115,7 @@ bool fAlerts = DEFAULT_ALERTS; */ int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; bool ishush3 = strncmp(ASSETCHAINS_SYMBOL, "HUSH3",5) == 0 ? true : false; -const uint32_t z2zForkHeight = GetArg("-z2zforkheight",340000); +const uint32_t 340000 = GetArg("-z2zforkheight",340000); unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA; extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; @@ -1736,12 +1736,12 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { AssertLockHeld(cs_main); const uint32_t z2zTransitionWindow = 10; - const uint32_t z2zTransitionStart = z2zForkHeight - z2zTransitionWindow; + const uint32_t z2zTransitionStart = 340000 - z2zTransitionWindow; const uint32_t nHeight = chainActive.Height(); // This only applies to HUSH3, other chains can start off z2z via ac_private=1 if(ishush3) { - if((nHeight >= z2zTransitionStart) || (nHeight <= z2zForkHeight)) { + if((nHeight >= z2zTransitionStart) || (nHeight <= 340000)) { // During the z2z transition window, only coinbase tx's as part of blocks are allowed // Theory: We want an empty mempool at our fork block height, and the only way to assure that // is to have an empty mempool for a few previous blocks, to take care of potential re-orgs @@ -3364,7 +3364,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin bool ishush3 = strncmp(ASSETCHAINS_SYMBOL, "HUSH3",5) == 0 ? true : false; if(!ASSETCHAINS_PRIVATE && ishush3) { unsigned int nHeight = pindex->GetHeight(); - if(nHeight >= z2zForkHeight) { + if(nHeight >= 340000) { // At startup, HUSH3 doesn't know a block height yet and so we must wait until // connecting a block fprintf(stderr, "%s: Going full z2z at height %d!\n",__func__,nHeight); @@ -6337,7 +6337,7 @@ bool static LoadBlockIndexDB() // Try to detect if we are z2z based on height of blocks on disk // This helps to set it correctly on startup before a new block is connected - if(ishush3 && chainActive.Height() >= z2zForkHeight) { + if(ishush3 && chainActive.Height() >= 340000) { LogPrintf("%s: enabled ac_private=1 at height=%d\n", __func__, chainActive.Height()); ASSETCHAINS_PRIVATE = 1; }