mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-03 08:46:36 +00:00
fix online delete
This commit is contained in:
committed by
Nicholas Dudfield
parent
7a790246fb
commit
688b66e1e3
@@ -65,9 +65,12 @@ public:
|
||||
return {};
|
||||
|
||||
std::shared_lock<std::shared_mutex> lock(mutex_);
|
||||
if (transactionMap_.empty())
|
||||
return std::nullopt;
|
||||
return transactionMap_.begin()->second.second->getLgrSeq();
|
||||
for (const auto& [ledgerSeq, ledgerData] : ledgers_)
|
||||
{
|
||||
if (!ledgerData.transactions.empty())
|
||||
return ledgerSeq;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<LedgerIndex>
|
||||
|
||||
@@ -216,6 +216,10 @@ public:
|
||||
}
|
||||
BEAST_EXPECT(store.getLastRotated() == lastRotated);
|
||||
|
||||
SQLiteDatabase* const db =
|
||||
dynamic_cast<SQLiteDatabase*>(&env.app().getRelationalDatabase());
|
||||
BEAST_EXPECT(*db->getTransactionsMinLedgerSeq() == 3);
|
||||
|
||||
for (auto i = 3; i < deleteInterval + lastRotated; ++i)
|
||||
{
|
||||
ledgers.emplace(
|
||||
|
||||
Reference in New Issue
Block a user