Cleanups.

This commit is contained in:
JoelKatz
2013-08-12 01:26:43 -07:00
parent 54daa40b81
commit 72315bffe3
2 changed files with 11 additions and 4 deletions

View File

@@ -1832,11 +1832,14 @@ bool Ledger::pendSaveValidated (bool isSynchronous, bool isCurrent)
{
saveValidatedLedger(isCurrent);
}
else if (isCurrent)
{
getApp().getJobQueue ().addJob (jtPUBLEDGER, "Ledger::pendSave",
BIND_TYPE (&Ledger::saveValidatedLedgerAsync, shared_from_this (), P_1, isCurrent));
}
else
{
getApp().getJobQueue ().addJob (
isCurrent ? jtPUBLEDGER : jtPUBOLDLEDGER,
isCurrent ? "Ledger::pendSave" : "Ledger::pendOldSave",
getApp().getJobQueue ().addLimitJob (jtPUBOLDLEDGER, "Ledger::pendOldSave", 2,
BIND_TYPE (&Ledger::saveValidatedLedgerAsync, shared_from_this (), P_1, isCurrent));
}

View File

@@ -546,7 +546,7 @@ void LedgerMaster::advanceThread()
if (pubLedgers.empty())
{
if (!getConfig().RUN_STANDALONE && !getApp().getFeeTrack().isLoadedLocal() &&
(getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 3) &&
(getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 10) &&
(mValidLedger->getLedgerSeq() == mPubLedger->getLedgerSeq()))
{ // We are in sync, so can acquire
uint32 missing = mCompleteLedgers.prevMissing(mPubLedger->getLedgerSeq());
@@ -570,7 +570,11 @@ void LedgerMaster::advanceThread()
getApp().getInboundLedgers().findCreate(nextLedger->getParentHash(),
nextLedger->getLedgerSeq() - 1);
if (acq && acq->isComplete() && !acq->isFailed())
{
ledger = acq->getLedger();
getApp().getInboundLedgers().findCreate(ledger->getParentHash(),
ledger->getLedgerSeq() - 1);
}
sl.lock();