Skip to content

Commit

Permalink
fix bug where we did not check the root node in the cache when reorde…
Browse files Browse the repository at this point in the history
…ring the trie
  • Loading branch information
Kay Kurokawa committed Dec 28, 2017
1 parent 40e034e commit d29f110
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/claimtrie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,12 @@ bool CClaimTrieCache::reorderTrieNode(const std::string& name, bool fCheckTakeov
cachedNode = cache.find(name);
if (cachedNode == cache.end())
{
CClaimTrieNode* currentNode = &(base->root);
CClaimTrieNode* currentNode;
cachedNode = cache.find("");
if(cachedNode == cache.end())
currentNode = &(base->root);
else
currentNode = cachedNode->second;
for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur)
{
std::string sCurrentSubstring(name.begin(), itCur);
Expand Down

0 comments on commit d29f110

Please sign in to comment.