Off by one in hasNode

This commit is contained in:
JoelKatz
2013-04-21 17:21:23 -07:00
parent 6bbef15e4d
commit 9c0a156c13

View File

@@ -472,7 +472,7 @@ bool SHAMap::deepCompare(SHAMap& other)
bool SHAMap::hasNode(const SHAMapNode& nodeID, const uint256& nodeHash)
{
SHAMapTreeNode* node = root.get();
while (node->isInner() && (node->getDepth() <= nodeID.getDepth()))
while (node->isInner() && (node->getDepth() < nodeID.getDepth()))
{
int branch = node->selectBranch(nodeID.getNodeID());
if (node->isEmptyBranch(branch))