Add a "full history" mode that causes the node to try to keep full history

going back to the genesis ledger. Not fully implemented yet.
This commit is contained in:
JoelKatz
2012-10-22 10:31:07 -07:00
parent e2e7eca1f1
commit 8705d0258d
7 changed files with 40 additions and 1 deletions

View File

@@ -113,6 +113,13 @@ void Application::run()
else
startNewLedger();
if (theConfig.FULL_HISTORY && (theConfig.START_UP != Config::LOAD))
{
Ledger::pointer ledger = Ledger::getLastFullLedger();
if (ledger)
mMasterLedger.setLastFullLedger(ledger);
}
//
// Begin validation and ip maintenance.
// - Wallet maintains local information: including identity and network connection persistence information.
@@ -215,7 +222,7 @@ void Application::loadOldLedger()
{
try
{
Ledger::pointer lastLedger = Ledger::getSQL("SELECT * from Ledgers order by LedgerSeq desc limit 1;");
Ledger::pointer lastLedger = Ledger::getLastFullLedger();
if (!lastLedger)
{
@@ -244,6 +251,7 @@ void Application::loadOldLedger()
cLog(lsFATAL) << "Ledger is not sane.";
exit(-1);
}
mMasterLedger.setLastFullLedger(lastLedger);
Ledger::pointer openLedger = boost::make_shared<Ledger>(false, boost::ref(*lastLedger));
mMasterLedger.switchLedgers(lastLedger, openLedger);