mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Dispatch save accepted ledger better.
This commit is contained in:
@@ -400,8 +400,8 @@ uint256 Ledger::getHash()
|
||||
return mHash;
|
||||
}
|
||||
|
||||
void Ledger::saveAcceptedLedger(bool fromConsensus, LoadEvent::pointer event)
|
||||
{ // can be called in a different thread
|
||||
void Ledger::saveAcceptedLedger(Job&, bool fromConsensus)
|
||||
{
|
||||
cLog(lsTRACE) << "saveAcceptedLedger " << (fromConsensus ? "fromConsensus " : "fromAcquire ") << getLedgerSeq();
|
||||
static boost::format ledgerExists("SELECT LedgerSeq FROM Ledgers INDEXED BY SeqLedger where LedgerSeq = %d;");
|
||||
static boost::format deleteLedger("DELETE FROM Ledgers WHERE LedgerSeq = %d;");
|
||||
@@ -1530,8 +1530,8 @@ void Ledger::pendSave(bool fromConsensus)
|
||||
++sPendingSaves;
|
||||
}
|
||||
|
||||
boost::thread(boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), fromConsensus,
|
||||
theApp->getJobQueue().getLoadEvent(jtDISK, fromConsensus ? "Ledger::cSave" : "Ledger::save"))).detach();
|
||||
theApp->getJobQueue().addJob(jtPUBOLDLEDGER, // FIXME not old if fromConsensus
|
||||
boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), _1, fromConsensus));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user