Skip to content

Commit 7770bc5

Browse files
ckeshavaBronek
authored andcommitted
simplify the extraction of transactionID from Transaction object
1 parent 94c16d8 commit 7770bc5

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/ripple/rpc/handlers/AccountTx.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ populateJsonResponse(
333333
JsonOptions::include_date |
334334
JsonOptions::disable_API_prior_V2,
335335
false);
336-
jvObj[jss::hash] = to_string(
337-
txn->getSTransaction()->getTransactionID());
336+
jvObj[jss::hash] = to_string(txn->getID());
338337
jvObj[jss::ledger_index] = txn->getLedger();
339338
jvObj[jss::ledger_hash] =
340339
to_string(context.ledgerMaster.getHashBySeq(

src/ripple/rpc/handlers/Tx.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ populateJsonResponse(
349349
if (result.ledgerHash)
350350
response[jss::ledger_hash] = to_string(*result.ledgerHash);
351351

352-
response[jss::hash] =
353-
to_string(result.txn->getSTransaction()->getTransactionID());
352+
response[jss::hash] = to_string(result.txn->getID());
354353
if (result.validated)
355354
{
356355
response[jss::ledger_index] = result.txn->getLedger();

src/ripple/rpc/impl/TransactionSign.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,7 @@ transactionFormatResultImpl(Transaction::pointer tpTrans, unsigned apiVersion)
654654
{
655655
jvResult[jss::tx_json] =
656656
tpTrans->getJson(JsonOptions::disable_API_prior_V2);
657-
jvResult[jss::hash] =
658-
to_string(tpTrans->getSTransaction()->getTransactionID());
657+
jvResult[jss::hash] = to_string(tpTrans->getID());
659658
}
660659
else
661660
jvResult[jss::tx_json] = tpTrans->getJson(JsonOptions::none);

0 commit comments

Comments
 (0)