aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Dashjr <[email protected]>2011-05-27 00:05:16 -0400
committerLuke Dashjr <[email protected]>2011-12-16 19:05:41 -0500
commitcce16fdc6871defc02e1459ca89d08c492103417 (patch)
treecda468ed72847820a3588bf37aeb8518bccd5ac7 /src
parentMerge pull request #527 from TheBlueMatt/gitian-downloader (diff)
downloaddiscoin-cce16fdc6871defc02e1459ca89d08c492103417.tar.xz
discoin-cce16fdc6871defc02e1459ca89d08c492103417.zip
Add blockhash and blockindex to transaction info
Diffstat (limited to 'src')
-rw-r--r--src/rpc.cpp8
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)