From a025b3c4801e96aedda5b350cdfb752d2cc4ea91 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Tue, 11 Apr 2023 11:10:53 -0700 Subject: [PATCH] Move faulty assert --- src/ripple/nodestore/impl/Shard.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ripple/nodestore/impl/Shard.cpp b/src/ripple/nodestore/impl/Shard.cpp index 14bfe487303..8d0eab81153 100644 --- a/src/ripple/nodestore/impl/Shard.cpp +++ b/src/ripple/nodestore/impl/Shard.cpp @@ -688,9 +688,6 @@ Shard::finalize(bool writeSQLite, std::optional 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 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);