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

@@ -429,6 +429,12 @@ void Ledger::saveAcceptedLedger()
}
theApp->getOPs().pubLedger(shared_from_this());
if(theConfig.FULL_HISTORY)
{
// WRITEME: check for seamless ledger history
}
}
Ledger::pointer Ledger::getSQL(const std::string& sql)
@@ -498,6 +504,11 @@ Ledger::pointer Ledger::loadByHash(const uint256& ledgerHash)
return getSQL(sql);
}
Ledger::pointer Ledger::getLastFullLedger()
{
return getSQL("SELECT * from Ledgers order by LedgerSeq desc limit 1;");
}
void Ledger::addJson(Json::Value& ret, int options)
{
ret["ledger"] = getJson(options);