mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 12:15:54 +00:00
fix segfault in repair when seq < minSequence
This commit is contained in:
@@ -158,16 +158,21 @@ void
|
|||||||
BackendIndexer::doBooksRepair(
|
BackendIndexer::doBooksRepair(
|
||||||
BackendInterface const& backend,
|
BackendInterface const& backend,
|
||||||
std::optional<uint32_t> sequence)
|
std::optional<uint32_t> sequence)
|
||||||
{
|
|
||||||
if (!sequence)
|
|
||||||
{
|
{
|
||||||
auto rng = backend.fetchLedgerRangeNoThrow();
|
auto rng = backend.fetchLedgerRangeNoThrow();
|
||||||
|
|
||||||
if (!rng)
|
if (!rng)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!sequence)
|
||||||
sequence = rng->maxSequence;
|
sequence = rng->maxSequence;
|
||||||
}
|
|
||||||
|
if(sequence < rng->minSequence)
|
||||||
|
sequence = rng->minSequence;
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info)
|
BOOST_LOG_TRIVIAL(info)
|
||||||
<< __func__ << " sequence = " << std::to_string(*sequence);
|
<< __func__ << " sequence = " << std::to_string(*sequence);
|
||||||
|
|
||||||
ripple::uint256 zero = {};
|
ripple::uint256 zero = {};
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@@ -231,14 +236,17 @@ void
|
|||||||
BackendIndexer::doKeysRepair(
|
BackendIndexer::doKeysRepair(
|
||||||
BackendInterface const& backend,
|
BackendInterface const& backend,
|
||||||
std::optional<uint32_t> sequence)
|
std::optional<uint32_t> sequence)
|
||||||
{
|
|
||||||
if (!sequence)
|
|
||||||
{
|
{
|
||||||
auto rng = backend.fetchLedgerRangeNoThrow();
|
auto rng = backend.fetchLedgerRangeNoThrow();
|
||||||
|
|
||||||
if (!rng)
|
if (!rng)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!sequence)
|
||||||
sequence = rng->maxSequence;
|
sequence = rng->maxSequence;
|
||||||
}
|
|
||||||
|
if(sequence < rng->minSequence)
|
||||||
|
sequence = rng->minSequence;
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info)
|
BOOST_LOG_TRIVIAL(info)
|
||||||
<< __func__ << " sequence = " << std::to_string(*sequence);
|
<< __func__ << " sequence = " << std::to_string(*sequence);
|
||||||
|
|||||||
Reference in New Issue
Block a user