mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Clean up LedgerEntrySet and TransactionEngine:
* Reduce public interfaces * Remove wrapper functions * Remove freeze timed cutover code * Return results directly instead of via ref parameters
This commit is contained in:
committed by
Tom Ritchford
parent
5ce3ed3555
commit
67c666b033
@@ -261,30 +261,6 @@ Ledger::~Ledger ()
|
||||
}
|
||||
}
|
||||
|
||||
bool Ledger::enforceFreeze () const
|
||||
{
|
||||
|
||||
// Temporarily, the freze code can run in either
|
||||
// enforcing mode or non-enforcing mode. In
|
||||
// non-enforcing mode, freeze flags can be
|
||||
// manipulated, but freezing is not actually
|
||||
// enforced. Once freeze enforcing has been
|
||||
// enabled, this function can be removed
|
||||
|
||||
// Let freeze enforcement be tested
|
||||
// If you wish to test non-enforcing mode,
|
||||
// you must remove this line
|
||||
if (getConfig().RUN_STANDALONE)
|
||||
return true;
|
||||
|
||||
// Freeze enforcing date is September 15, 2014
|
||||
static std::uint32_t const enforceDate =
|
||||
iToSeconds (boost::posix_time::ptime (
|
||||
boost::gregorian::date (2014, boost::gregorian::Sep, 15)));
|
||||
|
||||
return mParentCloseTime >= enforceDate;
|
||||
}
|
||||
|
||||
void Ledger::setImmutable ()
|
||||
{
|
||||
// Updates the hash and marks the ledger and its maps immutable
|
||||
@@ -766,7 +742,7 @@ bool Ledger::saveValidatedLedger (bool current)
|
||||
<< "Transaction in ledger " << mLedgerSeq
|
||||
<< " affects no accounts";
|
||||
|
||||
*db <<
|
||||
*db <<
|
||||
(STTx::getMetaSQLInsertReplaceHeader () +
|
||||
vt.second->getTxn ()->getMetaSQL (
|
||||
getLedgerSeq (), vt.second->getEscMeta ()) + ";");
|
||||
@@ -953,7 +929,7 @@ bool Ledger::getHashesByIndex (
|
||||
auto db = getApp().getLedgerDB ().checkoutDb ();
|
||||
|
||||
boost::optional <std::string> lhO, phO;
|
||||
|
||||
|
||||
*db << "SELECT LedgerHash,PrevHash FROM Ledgers "
|
||||
"INDEXED BY SeqLedger Where LedgerSeq = :ls;",
|
||||
soci::into (lhO),
|
||||
@@ -1024,7 +1000,7 @@ Ledger::pointer Ledger::getLastFullLedger ()
|
||||
|
||||
if (!ledger)
|
||||
return ledger;
|
||||
|
||||
|
||||
ledger->setClosed ();
|
||||
|
||||
if (getApp().getOPs ().haveLedger (ledgerSeq))
|
||||
|
||||
Reference in New Issue
Block a user