reverted accidental use of c++11 const

don't skip build by dir alone
This commit is contained in:
Brannon King 2018-12-17 11:29:44 +01:00
parent 1bf736a13e
commit d740e3761c
4 changed files with 19 additions and 15 deletions

View file

@ -362,14 +362,11 @@ function build_dependency() {
PREFIX=$1 PREFIX=$1
LOG=$2 LOG=$2
BUILD=$3 BUILD=$3
if [ ! -d "${PREFIX}" ]; then
trap 'cleanup "${PREFIX}" "${LOG}"' INT TERM EXIT
cd "${LBRYCRD_DEPENDENCIES}" cd "${LBRYCRD_DEPENDENCIES}"
rm -rf ${PREFIX} mkdir -p "${PREFIX}"
mkdir -p "${PREFIX}" trap 'cleanup "${PREFIX}" "${LOG}"' INT TERM EXIT
"${BUILD}" "${LOG}" "${BUILD}" "${LOG}"
trap - INT TERM EXIT trap - INT TERM EXIT
fi
popd popd
} }

View file

@ -285,14 +285,16 @@ typedef std::vector<CClaimIndexElement> claimIndexElementListType;
struct claimsForNameType struct claimsForNameType
{ {
const std::vector<CClaimValue> claims; std::vector<CClaimValue> claims;
const std::vector<CSupportValue> supports; std::vector<CSupportValue> supports;
const int nLastTakeoverHeight; int nLastTakeoverHeight;
const std::string name; std::string name;
claimsForNameType(std::vector<CClaimValue> claims, std::vector<CSupportValue> supports, claimsForNameType(const std::vector<CClaimValue>& claims, const std::vector<CSupportValue>& supports,
int nLastTakeoverHeight, const std::string& name) int nLastTakeoverHeight, const std::string& name)
: claims(claims), supports(supports), nLastTakeoverHeight(nLastTakeoverHeight), name(name) {} : claims(claims), supports(supports), nLastTakeoverHeight(nLastTakeoverHeight), name(name) {}
virtual ~claimsForNameType() {}
}; };
class CClaimTrieCacheBase; class CClaimTrieCacheBase;
@ -528,7 +530,7 @@ public:
supportQueueRowType& expireSupportUndo, supportQueueRowType& expireSupportUndo,
std::vector<std::pair<std::string, int> >& takeoverHeightUndo); std::vector<std::pair<std::string, int> >& takeoverHeightUndo);
~CClaimTrieCacheBase() { clear(); } virtual ~CClaimTrieCacheBase() { clear(); }
virtual bool getProofForName(const std::string& name, CClaimTrieProof& proof) const; virtual bool getProofForName(const std::string& name, CClaimTrieProof& proof) const;
virtual bool getInfoForName(const std::string& name, CClaimValue& claim) const; virtual bool getInfoForName(const std::string& name, CClaimValue& claim) const;
@ -662,6 +664,8 @@ public:
CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true) CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true)
: CClaimTrieCacheBase(base, fRequireTakeoverHeights) {} : CClaimTrieCacheBase(base, fRequireTakeoverHeights) {}
virtual ~CClaimTrieCacheExpirationFork() {}
bool forkForExpirationChange(bool increment) const; bool forkForExpirationChange(bool increment) const;
// TODO: move the expiration fork code from main.cpp to overrides of increment/decrement block // TODO: move the expiration fork code from main.cpp to overrides of increment/decrement block
@ -677,6 +681,8 @@ public:
: CClaimTrieCacheExpirationFork(base, fRequireTakeoverHeights), : CClaimTrieCacheExpirationFork(base, fRequireTakeoverHeights),
overrideInsertNormalization(false), overrideRemoveNormalization(false) {} overrideInsertNormalization(false), overrideRemoveNormalization(false) {}
virtual ~CClaimTrieCacheNormalizationFork() {}
bool shouldNormalize() const; bool shouldNormalize() const;
// lower-case and normalize any input string name // lower-case and normalize any input string name

View file

@ -178,8 +178,8 @@ bool CClaimTrieCacheNormalizationFork::removeSupportFromMap(const std::string& n
} }
struct claimsForNormalization: public claimsForNameType { struct claimsForNormalization: public claimsForNameType {
const std::string normalized; std::string normalized;
claimsForNormalization(std::vector<CClaimValue> claims, std::vector<CSupportValue> supports, claimsForNormalization(const std::vector<CClaimValue>& claims, const std::vector<CSupportValue>& supports,
int nLastTakeoverHeight, const std::string& name, const std::string& normalized) int nLastTakeoverHeight, const std::string& name, const std::string& normalized)
: claimsForNameType(claims, supports, nLastTakeoverHeight, name), normalized(normalized) {} : claimsForNameType(claims, supports, nLastTakeoverHeight, name), normalized(normalized) {}
}; };
@ -199,7 +199,8 @@ bool CClaimTrieCacheNormalizationFork::normalizeAllNamesInTrieIfNecessary(insert
supportMapEntryType supports; supportMapEntryType supports;
owner->getSupportsForName(name, 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);
} }
}; };

View file

@ -23,7 +23,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
// Special difficulty rule for testnet: // Special difficulty rule for testnet:
// If the new block's timestamp is twice the target block time // If the new block's timestamp is twice the target block time
// then allow mining of a min-difficulty block. // 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. // of hashrate drops off the network.
// This rule was not implemented properly until testnet block 277299. // This rule was not implemented properly until testnet block 277299.
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2){ if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2){