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;
|
return mHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ledger::saveAcceptedLedger(bool fromConsensus, LoadEvent::pointer event)
|
void Ledger::saveAcceptedLedger(Job&, bool fromConsensus)
|
||||||
{ // can be called in a different thread
|
{
|
||||||
cLog(lsTRACE) << "saveAcceptedLedger " << (fromConsensus ? "fromConsensus " : "fromAcquire ") << getLedgerSeq();
|
cLog(lsTRACE) << "saveAcceptedLedger " << (fromConsensus ? "fromConsensus " : "fromAcquire ") << getLedgerSeq();
|
||||||
static boost::format ledgerExists("SELECT LedgerSeq FROM Ledgers INDEXED BY SeqLedger where LedgerSeq = %d;");
|
static boost::format ledgerExists("SELECT LedgerSeq FROM Ledgers INDEXED BY SeqLedger where LedgerSeq = %d;");
|
||||||
static boost::format deleteLedger("DELETE FROM Ledgers WHERE LedgerSeq = %d;");
|
static boost::format deleteLedger("DELETE FROM Ledgers WHERE LedgerSeq = %d;");
|
||||||
@@ -1530,8 +1530,8 @@ void Ledger::pendSave(bool fromConsensus)
|
|||||||
++sPendingSaves;
|
++sPendingSaves;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::thread(boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), fromConsensus,
|
theApp->getJobQueue().addJob(jtPUBOLDLEDGER, // FIXME not old if fromConsensus
|
||||||
theApp->getJobQueue().getLoadEvent(jtDISK, fromConsensus ? "Ledger::cSave" : "Ledger::save"))).detach();
|
boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), _1, fromConsensus));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "SHAMap.h"
|
#include "SHAMap.h"
|
||||||
#include "InstanceCounter.h"
|
#include "InstanceCounter.h"
|
||||||
#include "LoadMonitor.h"
|
#include "LoadMonitor.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
|
||||||
enum LedgerStateParms
|
enum LedgerStateParms
|
||||||
{
|
{
|
||||||
@@ -102,7 +103,7 @@ protected:
|
|||||||
|
|
||||||
static void incPendingSaves();
|
static void incPendingSaves();
|
||||||
static void decPendingSaves();
|
static void decPendingSaves();
|
||||||
void saveAcceptedLedger(bool fromConsensus, LoadEvent::pointer);
|
void saveAcceptedLedger(Job&, bool fromConsensus);
|
||||||
|
|
||||||
void updateFees();
|
void updateFees();
|
||||||
void zeroFees();
|
void zeroFees();
|
||||||
|
|||||||
Reference in New Issue
Block a user