Fix a case where we might try too quickly to re-acquire a ledger.

This commit is contained in:
JoelKatz
2013-01-09 15:55:41 -08:00
parent 7ed37066cf
commit cf284897bb

View File

@@ -444,19 +444,26 @@ void LedgerMaster::tryPublish()
}
else
{
LedgerAcquire::pointer acq = theApp->getMasterLedgerAcquire().findCreate(hash);
if (!acq->isDone())
if (theApp->getMasterLedgerAcquire().isFailure(hash))
{
acq->setAccept();
break;
}
else if (acq->isComplete() && !acq->isFailed())
{
mPubLedger = acq->getLedger();
mPubLedgers.push_back(mPubLedger);
cLog(lsFATAL) << "Unable to acquire a recent validated ledger";
}
else
cLog(lsWARNING) << "Failed to acquire a published ledger";
{
LedgerAcquire::pointer acq = theApp->getMasterLedgerAcquire().findCreate(hash);
if (!acq->isDone())
{
acq->setAccept();
break;
}
else if (acq->isComplete() && !acq->isFailed())
{
mPubLedger = acq->getLedger();
mPubLedgers.push_back(mPubLedger);
}
else
cLog(lsWARNING) << "Failed to acquire a published ledger";
}
}
}
}