mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
fix online delete
This commit is contained in:
@@ -65,9 +65,17 @@ public:
|
||||
return {};
|
||||
|
||||
std::shared_lock<std::shared_mutex> lock(mutex_);
|
||||
LedgerIndex minSeq = std::numeric_limits<LedgerIndex>::max();
|
||||
if (transactionMap_.empty())
|
||||
return std::nullopt;
|
||||
return transactionMap_.begin()->second.second->getLgrSeq();
|
||||
for (const auto& [_, txMeta] : transactionMap_)
|
||||
{
|
||||
if (txMeta.second && txMeta.second->getLgrSeq() < minSeq)
|
||||
minSeq = txMeta.second->getLgrSeq();
|
||||
}
|
||||
return minSeq == std::numeric_limits<LedgerIndex>::max()
|
||||
? std::nullopt
|
||||
: std::optional<LedgerIndex>(minSeq);
|
||||
}
|
||||
|
||||
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