fix: nftData unique bug (#1550)

Fix: failed to unique the NFT data in one ledger as we wish.
This commit is contained in:
cyan317
2024-07-25 11:05:28 +01:00
committed by GitHub
parent 77494245a9
commit 895f3c0059
9 changed files with 84 additions and 30 deletions

View File

@@ -165,13 +165,13 @@ LedgerEntryHandler::process(LedgerEntryHandler::Input input, Context const& ctx)
auto ledgerObject = sharedPtrBackend_->fetchLedgerObject(key, lgrInfo.seq, ctx.yield);
if (!ledgerObject || ledgerObject->empty()) {
if (not input.includeDeleted)
if (not input.includeDeleted)
return Error{Status{"entryNotFound"}};
auto const deletedSeq = sharedPtrBackend_->fetchLedgerObjectSeq(key, lgrInfo.seq, ctx.yield);
if (!deletedSeq)
if (!deletedSeq)
return Error{Status{"entryNotFound"}};
ledgerObject = sharedPtrBackend_->fetchLedgerObject(key, deletedSeq.value() - 1, ctx.yield);
if (!ledgerObject || ledgerObject->empty())
if (!ledgerObject || ledgerObject->empty())
return Error{Status{"entryNotFound"}};
output.deletedLedgerIndex = deletedSeq;
}