diff options
| author | Russell Yanofsky <[email protected]> | 2017-07-27 10:08:31 -0400 |
|---|---|---|
| committer | Russell Yanofsky <[email protected]> | 2019-01-15 12:42:00 -0400 |
| commit | 700c42b85d20e624bef4228eef062c93084efab5 (patch) | |
| tree | 60f0213d9b6671995ae6e7d2015d57ffdda89f4b /src/interfaces/wallet.cpp | |
| parent | Merge #14433: Add checksum in gitian build scripts for ossl (diff) | |
| download | discoin-700c42b85d20e624bef4228eef062c93084efab5.tar.xz discoin-700c42b85d20e624bef4228eef062c93084efab5.zip | |
Add height, depth, and hash methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code
This commit does not change behavior.
Co-authored-by: Ben Woosley <[email protected]>
Diffstat (limited to 'src/interfaces/wallet.cpp')
| -rw-r--r-- | src/interfaces/wallet.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 8db34ed75..489cf0981 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -333,7 +333,7 @@ public: if (mi == m_wallet.mapWallet.end()) { return false; } - num_blocks = ::chainActive.Height(); + num_blocks = locked_chain->getHeight().value_or(-1); block_time = ::chainActive.Tip()->GetBlockTime(); tx_status = MakeWalletTxStatus(*locked_chain, mi->second); return true; @@ -348,7 +348,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().value_or(-1); in_mempool = mi->second.InMempool(); order_form = mi->second.vOrderForm; tx_status = MakeWalletTxStatus(*locked_chain, mi->second); @@ -379,7 +379,7 @@ public: return false; } balances = getBalances(); - num_blocks = ::chainActive.Height(); + num_blocks = locked_chain->getHeight().value_or(-1); return true; } CAmount getBalance() override { return m_wallet.GetBalance(); } |