Improve backfill in validation gate.

This commit is contained in:
JoelKatz
2013-05-16 11:59:28 -07:00
parent c98a3e3895
commit 33b318c5bc

View File

@@ -549,7 +549,10 @@ void LedgerMaster::checkAccept(const uint256& hash, uint32 seq)
Ledger::pointer ledger = mLedgerHistory.getLedgerByHash(hash);
if (!ledger)
{
theApp->getMasterLedgerAcquire().findCreate(hash, seq);
return;
}
mValidLedger = ledger;
tryPublish();
@@ -567,6 +570,8 @@ void LedgerMaster::tryPublish()
}
else if (mValidLedger->getLedgerSeq() > (mPubLedger->getLedgerSeq() + MAX_LEDGER_GAP))
{
cLog(lsWARNING) << "Gap in validated ledger stream " << mPubLedger->getLedgerSeq() << " - " <<
mValidLedger->getLedgerSeq() - 1;
mPubLedger = mValidLedger;
mPubLedgers.push_back(mValidLedger);
}
@@ -605,11 +610,11 @@ void LedgerMaster::tryPublish()
{
if (theApp->getMasterLedgerAcquire().isFailure(hash))
{
cLog(lsFATAL) << "Unable to acquire a recent validated ledger";
cLog(lsWARNING) << "Unable to acquire a recent validated ledger";
}
else
{
LedgerAcquire::pointer acq = theApp->getMasterLedgerAcquire().findCreate(hash, 0);
LedgerAcquire::pointer acq = theApp->getMasterLedgerAcquire().findCreate(hash, seq);
if (!acq->isDone())
{
acq->setAccept();