fix bug where we did not check the root node in the cache when reordering the trie

This commit is contained in:
Kay Kurokawa 2017-12-26 15:12:52 -05:00
parent 40e034ef1b
commit d29f110a11

View file

@ -1704,7 +1704,12 @@ bool CClaimTrieCache::reorderTrieNode(const std::string& name, bool fCheckTakeov
cachedNode = cache.find(name); cachedNode = cache.find(name);
if (cachedNode == cache.end()) 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) for (std::string::const_iterator itCur = name.begin(); itCur != name.end(); ++itCur)
{ {
std::string sCurrentSubstring(name.begin(), itCur); std::string sCurrentSubstring(name.begin(), itCur);