Pathfinding performance improvements.

This commit is contained in:
JoelKatz
2013-04-09 19:42:57 -07:00
parent ab751ffb27
commit fd296b4411
11 changed files with 56 additions and 47 deletions

View File

@@ -169,7 +169,11 @@ void Application::setup()
{
cLog(lsINFO) << "Loading specified Ledger";
loadOldLedger(theConfig.START_LEDGER);
if (!loadOldLedger(theConfig.START_LEDGER))
{
theApp->stop();
exit(-1);
}
}
else if (theConfig.START_UP == Config::NETWORK)
{ // This should probably become the default once we have a stable network
@@ -389,7 +393,7 @@ void Application::startNewLedger()
}
}
void Application::loadOldLedger(const std::string& l)
bool Application::loadOldLedger(const std::string& l)
{
try
{
@@ -408,7 +412,7 @@ void Application::loadOldLedger(const std::string& l)
if (!loadLedger)
{
cLog(lsFATAL) << "No Ledger found?" << std::endl;
exit(-1);
return false;
}
loadLedger->setClosed();
@@ -418,19 +422,19 @@ void Application::loadOldLedger(const std::string& l)
{
cLog(lsFATAL) << "Ledger is empty.";
assert(false);
exit(-1);
return false;
}
if (!loadLedger->walkLedger())
{
cLog(lsFATAL) << "Ledger is missing nodes.";
exit(-1);
return false;
}
if (!loadLedger->assertSane())
{
cLog(lsFATAL) << "Ledger is not sane.";
exit(-1);
return false;
}
mLedgerMaster.setLedgerRangePresent(loadLedger->getLedgerSeq(), loadLedger->getLedgerSeq());
@@ -441,13 +445,14 @@ void Application::loadOldLedger(const std::string& l)
catch (SHAMapMissingNode&)
{
cLog(lsFATAL) << "Data is missing for selected ledger";
exit(-1);
return false;
}
catch (boost::bad_lexical_cast&)
{
cLog(lsFATAL) << "Ledger specified '" << l << "' is not valid";
exit(-1);
return false;
}
return true;
}
// vim:ts=4