diff --git a/src/cpp/ripple/SHAMap.cpp b/src/cpp/ripple/SHAMap.cpp index 0f1a56daf5..a918c99ec3 100644 --- a/src/cpp/ripple/SHAMap.cpp +++ b/src/cpp/ripple/SHAMap.cpp @@ -24,7 +24,6 @@ DECLARE_INSTANCE(SHAMapTreeNode); void SHAMapNode::setHash() const { std::size_t h = theApp->getNonceST() + (mDepth * 0x9e3779b9); - const unsigned int *ptr = reinterpret_cast(mNodeID.begin()); for (int i = (mDepth + 3) / 4; i >= 0; --i) boost::hash_combine(h, *ptr++); @@ -163,10 +162,11 @@ SHAMapTreeNode::pointer SHAMap::walkTo(const uint256& id, bool modify) while (!inNode->isLeaf()) { int branch = inNode->selectBranch(id); - if (inNode->isEmptyBranch(branch)) - return inNode; uint256 childHash = inNode->getChildHash(branch); + if (childHash.isZero()) + return inNode; + try { inNode = getNode(inNode->getChildNodeID(branch), childHash, false);