From d740e3761c0079ff0b2d16b72b7fc224d141dff7 Mon Sep 17 00:00:00 2001 From: Brannon King Date: Mon, 17 Dec 2018 11:29:44 +0100 Subject: [PATCH] reverted accidental use of c++11 const don't skip build by dir alone --- reproducible_build.sh | 7 ++----- src/claimtrie.h | 18 ++++++++++++------ src/claimtrieForks.cpp | 7 ++++--- src/pow.cpp | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/reproducible_build.sh b/reproducible_build.sh index a99235206..8b4d49a8a 100755 --- a/reproducible_build.sh +++ b/reproducible_build.sh @@ -362,14 +362,11 @@ function build_dependency() { PREFIX=$1 LOG=$2 BUILD=$3 - if [ ! -d "${PREFIX}" ]; then - trap 'cleanup "${PREFIX}" "${LOG}"' INT TERM EXIT cd "${LBRYCRD_DEPENDENCIES}" - rm -rf ${PREFIX} - mkdir -p "${PREFIX}" + mkdir -p "${PREFIX}" + trap 'cleanup "${PREFIX}" "${LOG}"' INT TERM EXIT "${BUILD}" "${LOG}" trap - INT TERM EXIT - fi popd } diff --git a/src/claimtrie.h b/src/claimtrie.h index e753546f7..00c716532 100644 --- a/src/claimtrie.h +++ b/src/claimtrie.h @@ -285,14 +285,16 @@ typedef std::vector claimIndexElementListType; struct claimsForNameType { - const std::vector claims; - const std::vector supports; - const int nLastTakeoverHeight; - const std::string name; + std::vector claims; + std::vector supports; + int nLastTakeoverHeight; + std::string name; - claimsForNameType(std::vector claims, std::vector supports, + claimsForNameType(const std::vector& claims, const std::vector& supports, int nLastTakeoverHeight, const std::string& name) : claims(claims), supports(supports), nLastTakeoverHeight(nLastTakeoverHeight), name(name) {} + + virtual ~claimsForNameType() {} }; class CClaimTrieCacheBase; @@ -528,7 +530,7 @@ public: supportQueueRowType& expireSupportUndo, std::vector >& takeoverHeightUndo); - ~CClaimTrieCacheBase() { clear(); } + virtual ~CClaimTrieCacheBase() { clear(); } virtual bool getProofForName(const std::string& name, CClaimTrieProof& proof) const; virtual bool getInfoForName(const std::string& name, CClaimValue& claim) const; @@ -662,6 +664,8 @@ public: CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true) : CClaimTrieCacheBase(base, fRequireTakeoverHeights) {} + virtual ~CClaimTrieCacheExpirationFork() {} + bool forkForExpirationChange(bool increment) const; // TODO: move the expiration fork code from main.cpp to overrides of increment/decrement block @@ -677,6 +681,8 @@ public: : CClaimTrieCacheExpirationFork(base, fRequireTakeoverHeights), overrideInsertNormalization(false), overrideRemoveNormalization(false) {} + virtual ~CClaimTrieCacheNormalizationFork() {} + bool shouldNormalize() const; // lower-case and normalize any input string name diff --git a/src/claimtrieForks.cpp b/src/claimtrieForks.cpp index a31cc6e45..9ae15748d 100644 --- a/src/claimtrieForks.cpp +++ b/src/claimtrieForks.cpp @@ -178,8 +178,8 @@ bool CClaimTrieCacheNormalizationFork::removeSupportFromMap(const std::string& n } struct claimsForNormalization: public claimsForNameType { - const std::string normalized; - claimsForNormalization(std::vector claims, std::vector supports, + std::string normalized; + claimsForNormalization(const std::vector& claims, const std::vector& supports, int nLastTakeoverHeight, const std::string& name, const std::string& normalized) : claimsForNameType(claims, supports, nLastTakeoverHeight, name), normalized(normalized) {} }; @@ -199,7 +199,8 @@ bool CClaimTrieCacheNormalizationFork::normalizeAllNamesInTrieIfNecessary(insert supportMapEntryType supports; owner->getSupportsForName(name, supports); - hits.push_back(claimsForNormalization(node->claims, supports, node->nHeightOfLastTakeover, name, normalized)); + const claimsForNormalization cfn(node->claims, supports, node->nHeightOfLastTakeover, name, normalized); + hits.push_back(cfn); } }; diff --git a/src/pow.cpp b/src/pow.cpp index 328c19f60..396ee6c24 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -23,7 +23,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead // Special difficulty rule for testnet: // If the new block's timestamp is twice the target block time // then allow mining of a min-difficulty block. - // This is to prevent the testnet from gettig stuck when a large amount + // This is to prevent the testnet from getting stuck when a large amount // of hashrate drops off the network. // This rule was not implemented properly until testnet block 277299. if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2){