Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,076 Lines • ▼ Show 20 Lines | bool CWalletTx::IsTrusted(interfaces::Chain::Lock &locked_chain) const { | ||||
return IsTrusted(locked_chain, s); | return IsTrusted(locked_chain, s); | ||||
} | } | ||||
bool CWalletTx::IsTrusted(interfaces::Chain::Lock &locked_chain, | bool CWalletTx::IsTrusted(interfaces::Chain::Lock &locked_chain, | ||||
std::set<TxId> &trusted_parents) const { | std::set<TxId> &trusted_parents) const { | ||||
// Quick answer in most cases | // Quick answer in most cases | ||||
TxValidationState state; | TxValidationState state; | ||||
if (!locked_chain.contextualCheckTransactionForCurrentBlock( | if (!locked_chain.contextualCheckTransactionForCurrentBlock( | ||||
Params().GetConsensus(), *tx, state)) { | this->pwallet->chainParams.GetConsensus(), *tx, state)) { | ||||
return false; | return false; | ||||
} | } | ||||
int nDepth = GetDepthInMainChain(); | int nDepth = GetDepthInMainChain(); | ||||
if (nDepth >= 1) { | if (nDepth >= 1) { | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | void CWallet::AvailableCoins(interfaces::Chain::Lock &locked_chain, | ||||
bool allow_used_addresses = | bool allow_used_addresses = | ||||
!IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE) || | !IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE) || | ||||
(coinControl && !coinControl->m_avoid_address_reuse); | (coinControl && !coinControl->m_avoid_address_reuse); | ||||
const int min_depth = {coinControl ? coinControl->m_min_depth | const int min_depth = {coinControl ? coinControl->m_min_depth | ||||
: DEFAULT_MIN_DEPTH}; | : DEFAULT_MIN_DEPTH}; | ||||
const int max_depth = {coinControl ? coinControl->m_max_depth | const int max_depth = {coinControl ? coinControl->m_max_depth | ||||
: DEFAULT_MAX_DEPTH}; | : DEFAULT_MAX_DEPTH}; | ||||
const Consensus::Params params = Params().GetConsensus(); | const Consensus::Params params = this->chainParams.GetConsensus(); | ||||
std::set<TxId> trusted_parents; | std::set<TxId> trusted_parents; | ||||
for (const auto &entry : mapWallet) { | for (const auto &entry : mapWallet) { | ||||
const TxId &wtxid = entry.first; | const TxId &wtxid = entry.first; | ||||
const CWalletTx &wtx = entry.second; | const CWalletTx &wtx = entry.second; | ||||
TxValidationState state; | TxValidationState state; | ||||
if (!locked_chain.contextualCheckTransactionForCurrentBlock( | if (!locked_chain.contextualCheckTransactionForCurrentBlock( | ||||
▲ Show 20 Lines • Show All 2,224 Lines • Show Last 20 Lines |