diff options
Diffstat (limited to 'src/interfaces/wallet.cpp')
-rw-r--r-- | src/interfaces/wallet.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 672a557d41..a2cae2a7a7 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -318,7 +318,8 @@ public: } bool tryGetTxStatus(const uint256& txid, interfaces::WalletTxStatus& tx_status, - int& num_blocks) override + int& num_blocks, + int64_t& block_time) override { auto locked_chain = m_wallet.chain().lock(true /* try_lock */); if (!locked_chain) { @@ -332,7 +333,13 @@ public: if (mi == m_wallet.mapWallet.end()) { return false; } - num_blocks = ::chainActive.Height(); + 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; } @@ -346,7 +353,7 @@ public: LOCK(m_wallet.cs_wallet); auto mi = m_wallet.mapWallet.find(txid); if (mi != m_wallet.mapWallet.end()) { - num_blocks = ::chainActive.Height(); + num_blocks = locked_chain->getHeight().get_value_or(-1); in_mempool = mi->second.InMempool(); order_form = mi->second.vOrderForm; tx_status = MakeWalletTxStatus(*locked_chain, mi->second); @@ -377,7 +384,7 @@ public: return false; } balances = getBalances(); - num_blocks = ::chainActive.Height(); + num_blocks = locked_chain->getHeight().get_value_or(-1); return true; } CAmount getBalance() override { return m_wallet.GetBalance(); } @@ -486,6 +493,10 @@ public: { return MakeHandler(m_wallet.NotifyWatchonlyChanged.connect(fn)); } + std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override + { + return MakeHandler(m_wallet.NotifyCanGetAddressesChanged.connect(fn)); + } std::shared_ptr<CWallet> m_shared_wallet; CWallet& m_wallet; |