aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index e24d1111c7..c895d5af8c 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -166,13 +166,13 @@ static void WalletTxToJSON(const CWallet& wallet, const CWalletTx& wtx, UniValue
entry.pushKV("confirmations", confirms);
if (wtx.IsCoinBase())
entry.pushKV("generated", true);
- if (confirms > 0)
+ if (auto* conf = wtx.state<TxStateConfirmed>())
{
- entry.pushKV("blockhash", wtx.m_confirm.hashBlock.GetHex());
- entry.pushKV("blockheight", wtx.m_confirm.block_height);
- entry.pushKV("blockindex", wtx.m_confirm.nIndex);
+ entry.pushKV("blockhash", conf->confirmed_block_hash.GetHex());
+ entry.pushKV("blockheight", conf->confirmed_block_height);
+ entry.pushKV("blockindex", conf->position_in_block);
int64_t block_time;
- CHECK_NONFATAL(chain.findBlock(wtx.m_confirm.hashBlock, FoundBlock().time(block_time)));
+ CHECK_NONFATAL(chain.findBlock(conf->confirmed_block_hash, FoundBlock().time(block_time)));
entry.pushKV("blocktime", block_time);
} else {
entry.pushKV("trusted", CachedTxIsTrusted(wallet, wtx));