diff options
| author | Luke Dashjr <[email protected]> | 2011-05-27 00:05:16 -0400 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2011-12-16 19:05:41 -0500 |
| commit | cce16fdc6871defc02e1459ca89d08c492103417 (patch) | |
| tree | cda468ed72847820a3588bf37aeb8518bccd5ac7 | |
| parent | Merge pull request #527 from TheBlueMatt/gitian-downloader (diff) | |
| download | discoin-cce16fdc6871defc02e1459ca89d08c492103417.tar.xz discoin-cce16fdc6871defc02e1459ca89d08c492103417.zip | |
Add blockhash and blockindex to transaction info
| -rw-r--r-- | src/rpc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp index 885ffd1f2..accaf19ae 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -90,7 +90,13 @@ Value ValueFromAmount(int64 amount) void WalletTxToJSON(const CWalletTx& wtx, Object& entry) { - entry.push_back(Pair("confirmations", wtx.GetDepthInMainChain())); + int confirms = wtx.GetDepthInMainChain(); + entry.push_back(Pair("confirmations", confirms)); + if (confirms) + { + entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex())); + entry.push_back(Pair("blockindex", wtx.nIndex)); + } entry.push_back(Pair("txid", wtx.GetHash().GetHex())); entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime())); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) |