mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Finish "txn <id>" RPC command.
This commit is contained in:
@@ -400,6 +400,16 @@ Json::Value RPCServer::doTx(Json::Value& params)
|
||||
|
||||
if(Transaction::isHexTxID(param1))
|
||||
{ // transaction by ID
|
||||
Json::Value ret;
|
||||
uint256 txid(param1);
|
||||
if(theApp->getWallet().getTxJson(txid, ret))
|
||||
return ret;
|
||||
|
||||
Transaction::pointer txn=theApp->getMasterLedger().getCurrentLedger()->getTransaction(txid);
|
||||
if(!txn) txn=theApp->getMasterLedger().getClosingLedger()->getTransaction(txid);
|
||||
if(!txn) txn=Transaction::load(txid);
|
||||
if(!txn) return JSONRPCError(500, "Transaction not found");
|
||||
return txn->getJson(true);
|
||||
}
|
||||
|
||||
if(extractString(param2, params, 1))
|
||||
|
||||
Reference in New Issue
Block a user