MCPcopy Create free account
hub / github.com/ElementsProject/elements / MakeWalletTxStatus

Function MakeWalletTxStatus

src/wallet/interfaces.cpp:94–110  ·  view source on GitHub ↗

Construct wallet tx status struct.

Source from the content-addressed store, hash-verified

92
93//! Construct wallet tx status struct.
94WalletTxStatus MakeWalletTxStatus(const CWallet& wallet, const CWalletTx& wtx)
95{
96 WalletTxStatus result;
97 result.block_height =
98 wtx.state<TxStateConfirmed>() ? wtx.state<TxStateConfirmed>()->confirmed_block_height :
99 wtx.state<TxStateConflicted>() ? wtx.state<TxStateConflicted>()->conflicting_block_height :
100 std::numeric_limits<int>::max();
101 result.blocks_to_maturity = wallet.GetTxBlocksToMaturity(wtx);
102 result.depth_in_main_chain = wallet.GetTxDepthInMainChain(wtx);
103 result.time_received = wtx.nTimeReceived;
104 result.lock_time = wtx.tx->nLockTime;
105 result.is_trusted = CachedTxIsTrusted(wallet, wtx);
106 result.is_abandoned = wtx.isAbandoned();
107 result.is_coinbase = wtx.IsCoinBase();
108 result.is_in_main_chain = wallet.IsTxInMainChain(wtx);
109 return result;
110}
111
112//! Construct wallet TxOut struct.
113WalletTxOut MakeWalletTxOut(const CWallet& wallet,

Callers 2

tryGetTxStatusMethod · 0.85
getWalletTxDetailsMethod · 0.85

Calls 6

CachedTxIsTrustedFunction · 0.85
GetTxBlocksToMaturityMethod · 0.80
GetTxDepthInMainChainMethod · 0.80
isAbandonedMethod · 0.80
IsTxInMainChainMethod · 0.80
IsCoinBaseMethod · 0.45

Tested by

no test coverage detected