mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
More work on ledger sequencing:
Track whether ledger is accepted. Assert on modifications to an accepted ledger. Save accepted ledgers to DB. Load ledger by hash/index. Ledger history functions, ledger canonicalization. 'Push' ledger to history.
This commit is contained in:
@@ -24,6 +24,23 @@ uint64 LedgerMaster::getBalance(std::string& addr)
|
||||
return mCurrentLedger->getBalance(humanTo160(addr));
|
||||
}
|
||||
|
||||
bool LedgerMaster::addTransaction(Transaction::pointer transaction)
|
||||
{
|
||||
return mCurrentLedger->applyTransaction(transaction)==Ledger::TR_SUCCESS;
|
||||
}
|
||||
|
||||
void LedgerMaster::pushLedger(Ledger::pointer newLedger)
|
||||
{
|
||||
ScopedLock sl(mLock);
|
||||
if(!!mFinalizingLedger)
|
||||
{
|
||||
mFinalizingLedger->setClosed();
|
||||
mFinalizingLedger->setAccepted();
|
||||
mLedgerHistory.addAcceptedLedger(mFinalizingLedger);
|
||||
}
|
||||
mFinalizingLedger=mCurrentLedger;
|
||||
mCurrentLedger=newLedger;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user