mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
fix txn hash lookup from index
This commit is contained in:
@@ -2380,14 +2380,11 @@ LedgerMaster::txnIDfromIndex(uint32_t ledgerSeq, uint32_t txnIndex)
|
||||
if (!lgr || lgr->txs.empty())
|
||||
return {};
|
||||
|
||||
uint32_t counter = 0;
|
||||
for (auto it = lgr->txs.begin(); it != lgr->txs.end() && counter <= txnIndex; it++, counter++)
|
||||
{
|
||||
if (counter != txnIndex)
|
||||
continue;
|
||||
|
||||
return it->first->getTransactionID();
|
||||
}
|
||||
for (auto it = lgr->txs.begin(); it != lgr->txs.end(); it++)
|
||||
if (it->first && it->second &&
|
||||
it->second->isFieldPresent(sfTransactionIndex) &&
|
||||
it->second->getFieldU32(sfTransactionIndex) == txnIndex)
|
||||
return it->first->getTransactionID();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user