aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bitcoinrpc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 1f05fa8628..cd08d95d29 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -91,7 +91,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)