From bf45e835fba9be0dbd8211c44011cd830e658a5e Mon Sep 17 00:00:00 2001 From: Jimmy Kiselak Date: Thu, 29 Oct 2015 00:17:21 -0400 Subject: [PATCH] remove unnecessary non-const function, make other function const --- src/claimtrie.cpp | 15 ++------------- src/claimtrie.h | 3 +-- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/claimtrie.cpp b/src/claimtrie.cpp index 576bda88d..9d21210a0 100644 --- a/src/claimtrie.cpp +++ b/src/claimtrie.cpp @@ -448,9 +448,9 @@ bool CClaimTrie::getQueueRow(int nHeight, std::vector& row) co return db.Read(std::make_pair(QUEUE_ROW, nHeight), row); } -bool CClaimTrie::getExpirationQueueRow(int nHeight, std::vector& row) +bool CClaimTrie::getExpirationQueueRow(int nHeight, std::vector& row) const { - valueQueueType::iterator itQueueRow = dirtyExpirationQueueRows.find(nHeight); + valueQueueType::const_iterator itQueueRow = dirtyExpirationQueueRows.find(nHeight); if (itQueueRow != dirtyExpirationQueueRows.end()) { row = itQueueRow->second; @@ -515,17 +515,6 @@ void CClaimTrie::updateSupportQueue(int nHeight, std::vectorsecond.swap(row); } -bool CClaimTrie::getSupportNode(std::string name, supportMapNodeType& node) -{ - supportMapType::iterator itNode = dirtySupportNodes.find(name); - if (itNode != dirtySupportNodes.end()) - { - node = itNode->second; - return true; - } - return db.Read(std::make_pair(SUPPORT, name), node); -} - bool CClaimTrie::getSupportNode(std::string name, supportMapNodeType& node) const { supportMapType::const_iterator itNode = dirtySupportNodes.find(name); diff --git a/src/claimtrie.h b/src/claimtrie.h index 317f9810e..0db798ba0 100644 --- a/src/claimtrie.h +++ b/src/claimtrie.h @@ -232,8 +232,7 @@ public: bool expirationQueueEmpty() const; void setExpirationTime(int t); bool getQueueRow(int nHeight, std::vector& row) const; - bool getExpirationQueueRow(int nHeight, std::vector& row); - bool getSupportNode(std::string name, supportMapNodeType& node); + bool getExpirationQueueRow(int nHeight, std::vector& row) const; bool getSupportNode(std::string name, supportMapNodeType& node) const; bool getSupportQueueRow(int nHeight, std::vector& row) const; bool haveClaim(const std::string& name, const uint256& txhash, uint32_t nOut) const;