Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show All 19 Lines | |||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <support/allocators/secure.h> | #include <support/allocators/secure.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <timedata.h> | #include <timedata.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <wallet/fees.h> | #include <wallet/fees.h> | ||||
#include <wallet/finaltx.h> | |||||
#include <wallet/rpcdump.h> | #include <wallet/rpcdump.h> | ||||
#include <wallet/rpcwallet.h> | #include <wallet/rpcwallet.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <wallet/walletutil.h> | #include <wallet/walletutil.h> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
▲ Show 20 Lines • Show All 57 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 CheckFinalTx below. Removed in upcoming commit. | // Temporary, for ContextualCheckTransactionForCurrentBlock below. | ||||
// Removed in upcoming commit. | |||||
LockAnnotation lock(::cs_main); | LockAnnotation lock(::cs_main); | ||||
WalletTxStatus result; | WalletTxStatus result; | ||||
CBlockIndex *block = LookupBlockIndex(wtx.hashBlock); | CBlockIndex *block = LookupBlockIndex(wtx.hashBlock); | ||||
result.block_height = | result.block_height = | ||||
(block ? block->nHeight : std::numeric_limits<int>::max()); | (block ? block->nHeight : 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; | ||||
result.is_final = CheckFinalTx(*wtx.tx); | CValidationState state; | ||||
result.is_final = ContextualCheckTransactionForCurrentBlock( | |||||
Params().GetConsensus(), *wtx.tx, state); | |||||
result.is_trusted = wtx.IsTrusted(locked_chain); | result.is_trusted = wtx.IsTrusted(locked_chain); | ||||
result.is_abandoned = wtx.isAbandoned(); | result.is_abandoned = wtx.isAbandoned(); | ||||
result.is_coinbase = wtx.IsCoinBase(); | result.is_coinbase = wtx.IsCoinBase(); | ||||
result.is_in_main_chain = wtx.IsInMainChain(locked_chain); | result.is_in_main_chain = wtx.IsInMainChain(locked_chain); | ||||
return result; | return result; | ||||
} | } | ||||
//! Construct wallet TxOut struct. | //! Construct wallet TxOut struct. | ||||
▲ Show 20 Lines • Show All 411 Lines • Show Last 20 Lines |