mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Handle a partial ledger in fixMismatch
This commit is contained in:
@@ -449,11 +449,21 @@ bool LedgerMaster::shouldAcquire (uint32 currentLedger, uint32 ledgerHistory, ui
|
||||
void LedgerMaster::fixMismatch (Ledger::ref ledger)
|
||||
{
|
||||
int invalidate = 0;
|
||||
uint256 hash;
|
||||
|
||||
for (uint32 lSeq = ledger->getLedgerSeq () - 1; lSeq > 0; --lSeq)
|
||||
if (haveLedger (lSeq))
|
||||
{
|
||||
uint256 hash = ledger->getLedgerHash (lSeq);
|
||||
try
|
||||
{
|
||||
hash = ledger->getLedgerHash (lSeq);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
WriteLog (lsWARNING, LedgerMaster) << "fixMismatch encounters partial ledger";
|
||||
clearLedger(lSeq);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hash.isNonZero ())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user