Don't crash on missing root node.

This commit is contained in:
JoelKatz
2013-06-15 04:12:35 -07:00
parent 2d8ddaedb4
commit b2ef016f1a

View File

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