removed superfluous fRequireTakeoverHeights

This commit is contained in:
Brannon King 2019-07-29 10:25:41 -06:00
parent 15b61996b5
commit 43214bc6d2
4 changed files with 8 additions and 12 deletions

View file

@ -579,7 +579,7 @@ bool CClaimTrieCacheBase::ReadFromDisk(const CBlockIndex* tip)
return false;
}
CClaimTrieCacheBase::CClaimTrieCacheBase(CClaimTrie* base, bool fRequireTakeoverHeights) : base(base), fRequireTakeoverHeights(fRequireTakeoverHeights)
CClaimTrieCacheBase::CClaimTrieCacheBase(CClaimTrie* base) : base(base)
{
assert(base);
nNextHeight = base->nNextHeight;
@ -1287,8 +1287,6 @@ int CClaimTrieCacheBase::getNumBlocksOfContinuousOwnership(const std::string& na
int CClaimTrieCacheBase::getDelayForName(const std::string& name) const
{
if (!fRequireTakeoverHeights)
return 0;
int nBlocksOfContinuousOwnership = getNumBlocksOfContinuousOwnership(name);
return std::min(nBlocksOfContinuousOwnership / base->nProportionalDelayFactor, 4032);
}

View file

@ -384,7 +384,7 @@ typedef std::vector<CClaimIndexElement> claimIndexElementListType;
class CClaimTrieCacheBase
{
public:
explicit CClaimTrieCacheBase(CClaimTrie* base, bool fRequireTakeoverHeights = true);
explicit CClaimTrieCacheBase(CClaimTrie* base);
virtual ~CClaimTrieCacheBase() = default;
uint256 getMerkleHash();
@ -487,8 +487,6 @@ private:
std::unordered_map<std::string, std::pair<uint160, int>> takeoverCache;
bool fRequireTakeoverHeights;
claimQueueType claimQueueCache; // claims not active yet: to be written to disk on flush
queueNameType claimQueueNameCache;
supportQueueType supportQueueCache; // supports not active yet: to be written to disk on flush
@ -565,7 +563,7 @@ private:
class CClaimTrieCacheExpirationFork : public CClaimTrieCacheBase
{
public:
explicit CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true);
explicit CClaimTrieCacheExpirationFork(CClaimTrie* base);
void setExpirationTime(int time);
int expirationTime() const override;
@ -591,8 +589,8 @@ private:
class CClaimTrieCacheNormalizationFork : public CClaimTrieCacheExpirationFork
{
public:
explicit CClaimTrieCacheNormalizationFork(CClaimTrie* base, bool fRequireTakeoverHeights = true)
: CClaimTrieCacheExpirationFork(base, fRequireTakeoverHeights), overrideInsertNormalization(false), overrideRemoveNormalization(false)
explicit CClaimTrieCacheNormalizationFork(CClaimTrie* base)
: CClaimTrieCacheExpirationFork(base), overrideInsertNormalization(false), overrideRemoveNormalization(false)
{
}

View file

@ -9,8 +9,8 @@
#include <boost/locale/localization_backend.hpp>
#include <boost/scope_exit.hpp>
CClaimTrieCacheExpirationFork::CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights)
: CClaimTrieCacheBase(base, fRequireTakeoverHeights)
CClaimTrieCacheExpirationFork::CClaimTrieCacheExpirationFork(CClaimTrie* base)
: CClaimTrieCacheBase(base)
{
setExpirationTime(Params().GetConsensus().GetExpirationTime(nNextHeight));
}

View file

@ -12,7 +12,7 @@ using namespace std;
class CClaimTrieCacheTest : public CClaimTrieCacheBase
{
public:
explicit CClaimTrieCacheTest(CClaimTrie* base): CClaimTrieCacheBase(base, false)
explicit CClaimTrieCacheTest(CClaimTrie* base): CClaimTrieCacheBase(base)
{
}