Skip to content

Commit

Permalink
Add ledger_hash, ledger_index to transaction_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 31, 2023
1 parent 0d8673c commit cdb3384
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ripple/rpc/handlers/TransactionEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ doTransactionEntry(RPC::JsonContext& context)
sttx->getJson(JsonOptions::none, false, {std::ref(hash)});
jvResult[jss::hash] = hash;

if (!lpLedger->open())
jvResult[jss::ledger_hash] = to_string(
context.ledgerMaster.getHashBySeq(lpLedger->seq()));

bool const validated =
context.ledgerMaster.isValidated(*lpLedger);

jvResult[jss::validated] = validated;
if (validated)
{
jvResult[jss::ledger_index] = lpLedger->seq();
if (auto closeTime = context.ledgerMaster.getCloseTimeBySeq(
lpLedger->seq()))
jvResult[jss::close_time_iso] =
Expand Down

0 comments on commit cdb3384

Please sign in to comment.