mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Remove remaining wallet accesses to node globals
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user