diff options
| author | Gavin Andresen <[email protected]> | 2011-12-19 15:14:22 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-12-19 15:14:22 -0500 |
| commit | bafb43d6c18c1bf7eb1fcc04bed85e45bd03e961 (patch) | |
| tree | a7b4a8c38b511a1ead8d5aa918e58e915354f983 /src/bitcoinrpc.cpp | |
| parent | add key.o and rpcdump.o to makefile.linux-mingw (diff) | |
| parent | Add blockhash and blockindex to transaction info (diff) | |
| download | discoin-bafb43d6c18c1bf7eb1fcc04bed85e45bd03e961.tar.xz discoin-bafb43d6c18c1bf7eb1fcc04bed85e45bd03e961.zip | |
Merge branch 'txn_block_info' of https://github.com/luke-jr/bitcoin
Diffstat (limited to 'src/bitcoinrpc.cpp')
| -rw-r--r-- | src/bitcoinrpc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 1f05fa862..cd08d95d2 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) |