aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/wallet.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2019-03-06 16:47:57 -0500
committerRussell Yanofsky <russ@yanofsky.org>2019-03-06 16:47:57 -0500
commitd358466de15ef29c1d2bccb9aebab360d574d1d0 (patch)
tree731dd3ff9701381826ca0d0e3598f2de488b812b /src/interfaces/wallet.cpp
parentb1b2b238928e7be044ad62cf1b222464907ece2c (diff)
downloadbitcoin-d358466de15ef29c1d2bccb9aebab360d574d1d0.tar.xz
Remove remaining wallet accesses to node globals
Diffstat (limited to 'src/interfaces/wallet.cpp')
-rw-r--r--src/interfaces/wallet.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp
index 97eadac6a9..60173b29ac 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;