diff options
| author | Russell Yanofsky <[email protected]> | 2019-03-06 16:47:57 -0500 |
|---|---|---|
| committer | Russell Yanofsky <[email protected]> | 2019-03-06 16:47:57 -0500 |
| commit | d358466de15ef29c1d2bccb9aebab360d574d1d0 (patch) | |
| tree | 731dd3ff9701381826ca0d0e3598f2de488b812b /src/interfaces/wallet.cpp | |
| parent | Remove use of CCoinsViewMemPool::GetCoin in wallet code (diff) | |
| download | discoin-d358466de15ef29c1d2bccb9aebab360d574d1d0.tar.xz discoin-d358466de15ef29c1d2bccb9aebab360d574d1d0.zip | |
Remove remaining wallet accesses to node globals
Diffstat (limited to 'src/interfaces/wallet.cpp')
| -rw-r--r-- | src/interfaces/wallet.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 97eadac6a..60173b29a 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -47,8 +47,6 @@ public: const CTransaction& get() override { return *m_tx; } - int64_t getVirtualSize() override { return GetVirtualTransactionSize(*m_tx); } - bool commit(WalletValueMap value_map, WalletOrderForm order_form, std::string& reject_reason) override @@ -99,12 +97,8 @@ WalletTx MakeWalletTx(interfaces::Chain::Lock& locked_chain, CWallet& wallet, co //! Construct wallet tx status struct. WalletTxStatus MakeWalletTxStatus(interfaces::Chain::Lock& locked_chain, const CWalletTx& wtx) { - LockAnnotation lock(::cs_main); // Temporary, for mapBlockIndex below. Removed in upcoming commit. - WalletTxStatus result; - auto mi = ::mapBlockIndex.find(wtx.hashBlock); - CBlockIndex* block = mi != ::mapBlockIndex.end() ? mi->second : nullptr; - result.block_height = (block ? block->nHeight : std::numeric_limits<int>::max()); + result.block_height = locked_chain.getBlockHeight(wtx.hashBlock).get_value_or(std::numeric_limits<int>::max()); result.blocks_to_maturity = wtx.GetBlocksToMaturity(locked_chain); result.depth_in_main_chain = wtx.GetDepthInMainChain(locked_chain); result.time_received = wtx.nTimeReceived; |