mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Move faulty assert (#4533)
This assert was put in the wrong place, but it only triggers if shards
are configured. This change moves the assert to the right place and
updates it to ensure correctness.
The assert could be hit after the server downloads some shards. It may
be necessary to restart after the shards are downloaded.
Note that asserts are normally checked only in debug builds, so release
packages should not be affected.
Introduced in: #4319 (66627b26cf)
This commit is contained in:
@@ -688,9 +688,6 @@ Shard::finalize(bool writeSQLite, std::optional<uint256> const& referenceHash)
|
||||
|
||||
ledger->stateMap().setLedgerSeq(ledgerSeq);
|
||||
ledger->txMap().setLedgerSeq(ledgerSeq);
|
||||
assert(
|
||||
ledger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
|
||||
ledger->read(keylet::fees()));
|
||||
ledger->setImmutable();
|
||||
if (!ledger->stateMap().fetchRoot(
|
||||
SHAMapHash{ledger->info().accountHash}, nullptr))
|
||||
@@ -713,6 +710,11 @@ Shard::finalize(bool writeSQLite, std::optional<uint256> const& referenceHash)
|
||||
if (writeSQLite && !storeSQLite(ledger))
|
||||
return fail("failed storing to SQLite databases");
|
||||
|
||||
assert(
|
||||
ledger->info().seq == ledgerSeq &&
|
||||
(ledger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
|
||||
ledger->read(keylet::fees())));
|
||||
|
||||
hash = ledger->info().parentHash;
|
||||
next = std::move(ledger);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user