aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-11-11 00:40:11 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-11-11 22:32:44 +0000
commita5e77959c8ff6a8bffa1621d7ea29ee8603c5a14 (patch)
tree3d9b21654f65add933b2afdf1ced509b1ec3252c /src
parent89e93135aedf984f7a98771f047e2beb6cdbdb8e (diff)
downloadbitcoin-a5e77959c8ff6a8bffa1621d7ea29ee8603c5a14.tar.xz
rpc: Expose block height of wallet transactions
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcwallet.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 0f146563bf..00742aed7a 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -142,6 +142,7 @@ static void WalletTxToJSON(interfaces::Chain& chain, interfaces::Chain::Lock& lo
if (confirms > 0)
{
entry.pushKV("blockhash", wtx.m_confirm.hashBlock.GetHex());
+ entry.pushKV("blockheight", wtx.m_confirm.block_height);
entry.pushKV("blockindex", wtx.m_confirm.nIndex);
int64_t block_time;
bool found_block = chain.findBlock(wtx.m_confirm.hashBlock, nullptr /* block */, &block_time);
@@ -1367,6 +1368,7 @@ static const std::string TransactionDescriptionString()
" \"generated\": xxx, (bool) Only present if transaction only input is a coinbase one.\n"
" \"trusted\": xxx, (bool) Only present if we consider transaction to be trusted and so safe to spend from.\n"
" \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n"
+ " \"blockheight\": n, (numeric) The block height containing the transaction.\n"
" \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n"
" \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
" \"txid\": \"transactionid\", (string) The transaction id.\n"