Fix crash bug on missing root.

This commit is contained in:
JoelKatz
2013-06-15 04:07:42 -07:00
parent 91e1b17e61
commit 4473b85eb7

View File

@@ -769,8 +769,10 @@ bool SHAMap::fetchRoot(uint256 const& hash, SHAMapSyncFilter* filter)
else
WriteLog (lsTRACE, SHAMap) << "Fetch root SHAMap node " << hash;
}
root = fetchNodeExternalNT(SHAMapNode(), hash);
if (!root)
Ledger::pointer newRoot = fetchNodeExternalNT(SHAMapNode(), hash);
if (newRoot)
root = newRoot;
else
{
Blob nodeData;
if (!filter || !filter->haveNode(SHAMapNode(), hash, nodeData))