Construct wallet tx status struct.
| 86 | |
| 87 | //! Construct wallet tx status struct. |
| 88 | WalletTxStatus 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. |
| 107 | WalletTxOut MakeWalletTxOut(CWallet& wallet, const CWalletTx& wtx, int n, int depth) |
no test coverage detected