MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / MakeWalletTxStatus

Function MakeWalletTxStatus

src/interfaces/wallet.cpp:88–104  ·  view source on GitHub ↗

Construct wallet tx status struct.

Source from the content-addressed store, hash-verified

86
87//! Construct wallet tx status struct.
88WalletTxStatus MakeWalletTxStatus(const CWalletTx& wtx)
89{
90 WalletTxStatus result;
91 auto mi = ::mapBlockIndex.find(wtx.hashBlock);
92 CBlockIndex* block = mi != ::mapBlockIndex.end() ? mi->second : nullptr;
93 result.block_height = (block ? block->nHeight : std::numeric_limits<int>::max());
94 result.blocks_to_maturity = wtx.GetBlocksToMaturity();
95 result.depth_in_main_chain = wtx.GetDepthInMainChain();
96 result.time_received = wtx.nTimeReceived;
97 result.lock_time = wtx.tx->nLockTime;
98 result.is_final = CheckFinalTx(*wtx.tx);
99 result.is_trusted = wtx.IsTrusted();
100 result.is_abandoned = wtx.isAbandoned();
101 result.is_coinbase = wtx.IsCoinBase();
102 result.is_in_main_chain = wtx.IsInMainChain();
103 return result;
104}
105
106//! Construct wallet TxOut struct.
107WalletTxOut MakeWalletTxOut(CWallet& wallet, const CWalletTx& wtx, int n, int depth)

Callers 2

tryGetTxStatusMethod · 0.85
getWalletTxDetailsMethod · 0.85

Calls 10

maxFunction · 0.85
CheckFinalTxFunction · 0.85
GetBlocksToMaturityMethod · 0.80
GetDepthInMainChainMethod · 0.80
IsTrustedMethod · 0.80
isAbandonedMethod · 0.80
IsInMainChainMethod · 0.80
findMethod · 0.45
endMethod · 0.45
IsCoinBaseMethod · 0.45

Tested by

no test coverage detected