From 2df70eeed14cae55b53a4a9a73c5d6361ace467f Mon Sep 17 00:00:00 2001 From: Brannon King Date: Mon, 29 Jul 2019 10:25:41 -0600 Subject: [PATCH] removed superfluous fRequireTakeoverHeights --- src/claimtrie.cpp | 4 +--- src/claimtrie.h | 10 ++++------ src/claimtrieforks.cpp | 4 ++-- src/test/claimtriecache_tests.cpp | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/claimtrie.cpp b/src/claimtrie.cpp index 4ac6f49d7..d075dbc06 100644 --- a/src/claimtrie.cpp +++ b/src/claimtrie.cpp @@ -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); } diff --git a/src/claimtrie.h b/src/claimtrie.h index bb0166772..46c4e8088 100644 --- a/src/claimtrie.h +++ b/src/claimtrie.h @@ -384,7 +384,7 @@ typedef std::vector 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> 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) { } diff --git a/src/claimtrieforks.cpp b/src/claimtrieforks.cpp index ae0a7c5da..7f4983c25 100644 --- a/src/claimtrieforks.cpp +++ b/src/claimtrieforks.cpp @@ -9,8 +9,8 @@ #include #include -CClaimTrieCacheExpirationFork::CClaimTrieCacheExpirationFork(CClaimTrie* base, bool fRequireTakeoverHeights) - : CClaimTrieCacheBase(base, fRequireTakeoverHeights) +CClaimTrieCacheExpirationFork::CClaimTrieCacheExpirationFork(CClaimTrie* base) + : CClaimTrieCacheBase(base) { setExpirationTime(Params().GetConsensus().GetExpirationTime(nNextHeight)); } diff --git a/src/test/claimtriecache_tests.cpp b/src/test/claimtriecache_tests.cpp index 8cad014b2..698370735 100644 --- a/src/test/claimtriecache_tests.cpp +++ b/src/test/claimtriecache_tests.cpp @@ -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) { }