Reduce exceptions during syncing.

This commit is contained in:
JoelKatz
2013-06-20 19:53:57 -07:00
parent 6bc6ed3e2e
commit a3e9d279dd

View File

@@ -327,11 +327,8 @@ SHAMapAddNode SHAMap::addKnownNode (const SHAMapNode& node, Blob const& rawNode,
if (fullBelowCache.isPresent (iNode->getChildHash (branch))) if (fullBelowCache.isPresent (iNode->getChildHash (branch)))
return SHAMapAddNode::okay (); return SHAMapAddNode::okay ();
try SHAMapTreeNode *nextNode = getNodePointerNT (iNode->getChildNodeID (branch), iNode->getChildHash (branch), filter);
{ if (!nextNode)
iNode = getNodePointer (iNode->getChildNodeID (branch), iNode->getChildHash (branch), filter);
}
catch (SHAMapMissingNode&)
{ {
if (iNode->getDepth () != (node.getDepth () - 1)) if (iNode->getDepth () != (node.getDepth () - 1))
{ {
@@ -361,6 +358,7 @@ SHAMapAddNode SHAMap::addKnownNode (const SHAMapNode& node, Blob const& rawNode,
mTNByID[node] = newNode; mTNByID[node] = newNode;
return SHAMapAddNode::useful (); return SHAMapAddNode::useful ();
} }
iNode = nextNode;
} }
WriteLog (lsTRACE, SHAMap) << "got node, already had it (late)"; WriteLog (lsTRACE, SHAMap) << "got node, already had it (late)";