MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / tryGetTxStatus

Method tryGetTxStatus

src/wallet/interfaces.cpp:331–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329 return result;
330 }
331 bool tryGetTxStatus(const Txid& txid,
332 interfaces::WalletTxStatus& tx_status,
333 int& num_blocks,
334 int64_t& block_time) override
335 {
336 TRY_LOCK(m_wallet->cs_wallet, locked_wallet);
337 if (!locked_wallet) {
338 return false;
339 }
340 auto mi = m_wallet->mapWallet.find(txid);
341 if (mi == m_wallet->mapWallet.end()) {
342 return false;
343 }
344 num_blocks = m_wallet->GetLastBlockHeight();
345 block_time = -1;
346 CHECK_NONFATAL(m_wallet->chain().findBlock(m_wallet->GetLastBlockHash(), FoundBlock().time(block_time)));
347 tx_status = MakeWalletTxStatus(*m_wallet, mi->second);
348 return true;
349 }
350 WalletTx getWalletTxDetails(const Txid& txid,
351 WalletTxStatus& tx_status,
352 WalletOrderForm& order_form,

Callers 1

indexMethod · 0.80

Calls 4

FoundBlockClass · 0.85
findMethod · 0.80
findBlockMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected