Skip to content

Commit

Permalink
Show nTime in RPC calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Feb 7, 2019
1 parent 90543e9 commit b77e473
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
entry.push_back(Pair("version", tx.nVersion));
entry.push_back(Pair("locktime", (int64_t)tx.nLockTime));
entry.push_back(Pair("tx-comment", tx.strTxComment));
entry.push_back(Pair("time", (int)tx.nTime));

UniValue vin(UniValue::VARR);
for (unsigned int i = 0; i < tx.vin.size(); i++) {
Expand Down Expand Up @@ -118,7 +119,6 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
CBlockIndex* pindex = (*mi).second;
if (chainActive.Contains(pindex)) {
entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight));
entry.push_back(Pair("time", pindex->GetBlockTime()));
entry.push_back(Pair("blocktime", pindex->GetBlockTime()));
}
else
Expand Down Expand Up @@ -155,6 +155,8 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
" \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n"
" \"version\" : n, (numeric) The version\n"
" \"locktime\" : ttt, (numeric) The lock time\n"
" \"tx-comment\" : ttt, (string) Comment added to transaction if any\n"
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"vin\" : [ (array of json objects)\n"
" {\n"
" \"txid\": \"id\", (string) The transaction id\n"
Expand Down Expand Up @@ -187,7 +189,6 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
" ],\n"
" \"blockhash\" : \"hash\", (string) the block hash\n"
" \"confirmations\" : n, (numeric) The confirmations\n"
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
"}\n"

Expand Down Expand Up @@ -466,6 +467,8 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
" \"size\" : n, (numeric) The transaction size\n"
" \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n"
" \"version\" : n, (numeric) The version\n"
" \"tx-comment\" : ttt, (string) Comment added to transaction if any\n"
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"locktime\" : ttt, (numeric) The lock time\n"
" \"vin\" : [ (array of json objects)\n"
" {\n"
Expand Down

0 comments on commit b77e473

Please sign in to comment.