option to return date of transaction in the JSON

This commit is contained in:
jed
2012-11-23 17:58:48 -08:00
parent 6bc817d377
commit 89f02efc16
11 changed files with 51 additions and 37 deletions

View File

@@ -306,11 +306,25 @@ bool Transaction::convertToTransactions(uint32 firstLedgerSeq, uint32 secondLedg
return true;
}
// options 1 to include the date of the transaction
Json::Value Transaction::getJson(int options) const
{
Json::Value ret(mTransaction->getJson(0));
if (mInLedger) ret["inLedger"]=mInLedger;
if (mInLedger)
{
ret["inLedger"]=mInLedger;
if(options==1)
{
Ledger::pointer ledger=theApp->getLedgerMaster().getLedgerBySeq(mInLedger);
if(ledger)
{
ret["date"]=ledger->getCloseTimeNC();
}
}
}
switch (mStatus)
{