diff --git a/src/cpp/ripple/ripple_SHAMapSync.cpp b/src/cpp/ripple/ripple_SHAMapSync.cpp index 52de73e431..2d41aa604b 100644 --- a/src/cpp/ripple/ripple_SHAMapSync.cpp +++ b/src/cpp/ripple/ripple_SHAMapSync.cpp @@ -440,6 +440,10 @@ bool SHAMap::deepCompare (SHAMap& other) bool SHAMap::hasInnerNode (const SHAMapNode& nodeID, uint256 const& nodeHash) { + boost::unordered_map::iterator it = mTNByID.find (nodeID); + if (it != mTNByID.end()) + return it->second->getNodeHash() == nodeHash; + SHAMapTreeNode* node = root.get (); while (node->isInner () && (node->getDepth () < nodeID.getDepth ())) @@ -474,7 +478,7 @@ bool SHAMap::hasLeafNode (uint256 const& tag, uint256 const& nodeHash) node = getNodePointer (node->getChildNodeID (branch), nextHash); } - return false; + return node->getNodeHash() == nodeHash; } static void addFPtoList (std::list& list, const uint256& hash, const Blob& blob)