aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/wallet.cpp')
-rw-r--r--src/interfaces/wallet.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp
index 489cf0981c..88c5db73a1 100644
--- a/src/interfaces/wallet.cpp
+++ b/src/interfaces/wallet.cpp
@@ -333,8 +333,13 @@ public:
if (mi == m_wallet.mapWallet.end()) {
return false;
}
- num_blocks = locked_chain->getHeight().value_or(-1);
- block_time = ::chainActive.Tip()->GetBlockTime();
+ if (Optional<int> height = locked_chain->getHeight()) {
+ num_blocks = *height;
+ block_time = locked_chain->getBlockTime(*height);
+ } else {
+ num_blocks = -1;
+ block_time = -1;
+ }
tx_status = MakeWalletTxStatus(*locked_chain, mi->second);
return true;
}