Skip to content

Commit

Permalink
Throwaway recent history logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ximinez committed Sep 5, 2024
1 parent c33b3f9 commit c52404d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,40 @@ NetworkOPsImp::beginConsensus(uint256 const& networkClosed)

return false;
}
else if (!m_ledgerMaster.isValidated(*prevLedger))
{
// Do not merge this block unless it proves useful.
auto parentLedger = prevLedger;
for (; parentLedger && !m_ledgerMaster.isValidated(*parentLedger) &&
parentLedger->info().seq > closingInfo.seq - 20;
parentLedger = m_ledgerMaster.getLedgerByHash(
parentLedger->info().parentHash))
{
JLOG(m_journal.debug())
<< "beginConsensus for " << closingInfo.seq << ". Ledger "
<< parentLedger->info().seq << " (" << parentLedger->info().hash
<< ") is not validated.";
}
if (parentLedger && m_ledgerMaster.isValidated(*parentLedger))
{
JLOG(m_journal.debug())
<< "beginConsensus for " << closingInfo.seq << ". Ledger "
<< parentLedger->info().seq << " (" << parentLedger->info().hash
<< ") IS validated.";
}
else
{
if (parentLedger)
JLOG(m_journal.warn())
<< "beginConsensus for " << closingInfo.seq << ". Previous "
<< closingInfo.seq - parentLedger->info().seq
<< " ledgers are not validated";
else
JLOG(m_journal.warn())
<< "beginConsensus for " << closingInfo.seq
<< ". Ran out of parent ledgers to check.";
}
}

assert(prevLedger->info().hash == closingInfo.parentHash);
assert(
Expand Down

0 comments on commit c52404d

Please sign in to comment.