aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/interfaces.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r--src/wallet/interfaces.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 57f1a6a67a..6489e2a5fc 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -82,7 +82,10 @@ WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
WalletTxStatus MakeWalletTxStatus(const CWallet& wallet, const CWalletTx& wtx)
{
WalletTxStatus result;
- result.block_height = wtx.m_confirm.block_height > 0 ? wtx.m_confirm.block_height : std::numeric_limits<int>::max();
+ result.block_height =
+ wtx.state<TxStateConfirmed>() ? wtx.state<TxStateConfirmed>()->confirmed_block_height :
+ wtx.state<TxStateConflicted>() ? wtx.state<TxStateConflicted>()->conflicting_block_height :
+ std::numeric_limits<int>::max();
result.blocks_to_maturity = wallet.GetTxBlocksToMaturity(wtx);
result.depth_in_main_chain = wallet.GetTxDepthInMainChain(wtx);
result.time_received = wtx.nTimeReceived;