Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | static WalletTx MakeWalletTx(interfaces::Chain::Lock &locked_chain, | ||||
result.is_coinbase = wtx.IsCoinBase(); | result.is_coinbase = wtx.IsCoinBase(); | ||||
return result; | return result; | ||||
} | } | ||||
//! Construct wallet tx status struct. | //! Construct wallet tx status struct. | ||||
static WalletTxStatus | static WalletTxStatus | ||||
MakeWalletTxStatus(interfaces::Chain::Lock &locked_chain, | MakeWalletTxStatus(interfaces::Chain::Lock &locked_chain, | ||||
const CWalletTx &wtx) { | const CWalletTx &wtx) { | ||||
// Temporary, for LookupBlockIndex below. Removed in upcoming commit. | |||||
LockAnnotation lock(::cs_main); | |||||
WalletTxStatus result; | WalletTxStatus result; | ||||
CBlockIndex *block = LookupBlockIndex(wtx.hashBlock); | |||||
result.block_height = | result.block_height = | ||||
(block ? block->nHeight : std::numeric_limits<int>::max()); | locked_chain.getBlockHeight(wtx.hashBlock) | ||||
.get_value_or(std::numeric_limits<int>::max()); | |||||
result.blocks_to_maturity = wtx.GetBlocksToMaturity(locked_chain); | result.blocks_to_maturity = wtx.GetBlocksToMaturity(locked_chain); | ||||
result.depth_in_main_chain = wtx.GetDepthInMainChain(locked_chain); | result.depth_in_main_chain = wtx.GetDepthInMainChain(locked_chain); | ||||
result.time_received = wtx.nTimeReceived; | result.time_received = wtx.nTimeReceived; | ||||
result.lock_time = wtx.tx->nLockTime; | result.lock_time = wtx.tx->nLockTime; | ||||
CValidationState state; | CValidationState state; | ||||
result.is_final = | result.is_final = | ||||
locked_chain.contextualCheckTransactionForCurrentBlock( | locked_chain.contextualCheckTransactionForCurrentBlock( | ||||
Params().GetConsensus(), *wtx.tx, state); | Params().GetConsensus(), *wtx.tx, state); | ||||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |