# HG changeset patch # User Luke Dashjr # Date 1338224210 0 # Node ID 494bece0648d220ccf7e087ce83779c5f34f7230 # Parent a0faaa0a6f523627d8dd4260d6169de44c0b2ade JSON-RPC: Add "blocktime" and (for wallet transactions) "timereceived" to transaction Object outputs diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -93,6 +93,7 @@ { entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight)); entry.push_back(Pair("time", (boost::int64_t)pindex->nTime)); + entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime)); } else entry.push_back(Pair("confirmations", 0)); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -38,9 +38,11 @@ { entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex())); entry.push_back(Pair("blockindex", wtx.nIndex)); + entry.push_back(Pair("blocktime", (boost::int64_t)(mapBlockIndex[wtx.hashBlock]->nTime))); } entry.push_back(Pair("txid", wtx.GetHash().GetHex())); entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime())); + entry.push_back(Pair("timereceived", (boost::int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) entry.push_back(Pair(item.first, item.second)); }