mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 04:05:51 +00:00
fix segfault in repair when seq < minSequence
This commit is contained in:
@@ -159,15 +159,20 @@ 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)
|
||||||
{
|
{
|
||||||
@@ -232,13 +237,16 @@ 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