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

View file

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

View file

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

View file

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