Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,994 Lines • ▼ Show 20 Lines | if (IsCurrentForAntiFeeSniping(chain, block_hash)) { | ||||
// constant. | // constant. | ||||
locktime = 0; | locktime = 0; | ||||
} | } | ||||
assert(locktime < LOCKTIME_THRESHOLD); | assert(locktime < LOCKTIME_THRESHOLD); | ||||
return locktime; | return locktime; | ||||
} | } | ||||
OutputType | OutputType | ||||
CWallet::TransactionChangeType(OutputType change_type, | CWallet::TransactionChangeType(const std::optional<OutputType> &change_type, | ||||
const std::vector<CRecipient> &vecSend) { | const std::vector<CRecipient> &vecSend) { | ||||
// If -changetype is specified, always use that change type. | // If -changetype is specified, always use that change type. | ||||
if (change_type != OutputType::CHANGE_AUTO) { | if (change_type) { | ||||
return change_type; | return *change_type; | ||||
} | } | ||||
// if m_default_address_type is legacy, use legacy address as change. | // if m_default_address_type is legacy, use legacy address as change. | ||||
if (m_default_address_type == OutputType::LEGACY) { | if (m_default_address_type == OutputType::LEGACY) { | ||||
return OutputType::LEGACY; | return OutputType::LEGACY; | ||||
} | } | ||||
// else use m_default_address_type for change | // else use m_default_address_type for change | ||||
▲ Show 20 Lines • Show All 1,387 Lines • ▼ Show 20 Lines | if (chain.relayMinFee().GetFeePerK() > HIGH_TX_FEE_PER_KB) { | ||||
AmountHighWarn("-minrelaytxfee") + Untranslated(" ") + | AmountHighWarn("-minrelaytxfee") + Untranslated(" ") + | ||||
_("The wallet will avoid paying less than the minimum relay fee.")); | _("The wallet will avoid paying less than the minimum relay fee.")); | ||||
} | } | ||||
walletInstance->m_spend_zero_conf_change = | walletInstance->m_spend_zero_conf_change = | ||||
gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | ||||
walletInstance->m_default_address_type = DEFAULT_ADDRESS_TYPE; | walletInstance->m_default_address_type = DEFAULT_ADDRESS_TYPE; | ||||
walletInstance->m_default_change_type = DEFAULT_CHANGE_TYPE; | walletInstance->m_default_change_type = OutputType::LEGACY; | ||||
walletInstance->WalletLogPrintf("Wallet completed loading in %15dms\n", | walletInstance->WalletLogPrintf("Wallet completed loading in %15dms\n", | ||||
GetTimeMillis() - nStart); | GetTimeMillis() - nStart); | ||||
// Try to top up keypool. No-op if the wallet is locked. | // Try to top up keypool. No-op if the wallet is locked. | ||||
walletInstance->TopUpKeyPool(); | walletInstance->TopUpKeyPool(); | ||||
LOCK(walletInstance->cs_wallet); | LOCK(walletInstance->cs_wallet); | ||||
▲ Show 20 Lines • Show All 660 Lines • Show Last 20 Lines |