fix for ctid on tx rpc (#177)

* fix for ctid on tx rpc

* clang-format

---------

Co-authored-by: Denis Angell <dangell@transia.co>
This commit is contained in:
RichardAH
2023-11-02 11:47:57 +01:00
committed by GitHub
parent b564fe3c92
commit 4d2ec0004b

View File

@@ -268,19 +268,18 @@ doTxHelp(RPC::Context& context, TxArgs args)
result.validated = isValidated(
context.ledgerMaster, ledger->info().seq, ledger->info().hash);
/*
// RH NOTE: this is now handled inside the Transaction class
// leaving a copy here in case for some reason it's needed again
// compute outgoing CTID
uint32_t lgrSeq = ledger->info().seq;
uint32_t txnIdx = meta->getAsObject().getFieldU32(sfTransactionIndex);
uint32_t netID = context.app.config().NETWORK_ID;
if (meta->getAsObject().isFieldPresent(sfTransactionIndex))
{
uint32_t lgrSeq = ledger->info().seq;
uint32_t txnIdx =
meta->getAsObject().getFieldU32(sfTransactionIndex);
uint32_t netID = context.app.config().NETWORK_ID;
if (txnIdx <= 0xFFFFU && netID < 0xFFFFU && lgrSeq < 0x0FFF'FFFFUL)
result.ctid =
RPC::encodeCTID(lgrSeq, (uint16_t)txnIdx, (uint16_t)netID);
*/
if (txnIdx <= 0xFFFFU && netID < 0xFFFFU && lgrSeq < 0x0FFF'FFFFUL)
result.ctid =
RPC::encodeCTID(lgrSeq, (uint16_t)txnIdx, (uint16_t)netID);
}
}
return {result, rpcSUCCESS};