Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,056 Lines • ▼ Show 20 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
vecSend); | vecSend); | ||||
LearnRelatedScripts(vchPubKey, change_type); | LearnRelatedScripts(vchPubKey, change_type); | ||||
scriptChange = GetScriptForDestination( | scriptChange = GetScriptForDestination( | ||||
GetDestinationForKey(vchPubKey, change_type)); | GetDestinationForKey(vchPubKey, change_type)); | ||||
} | } | ||||
CTxOut change_prototype_txout(Amount::zero(), scriptChange); | CTxOut change_prototype_txout(Amount::zero(), scriptChange); | ||||
coin_selection_params.change_output_size = | coin_selection_params.change_output_size = | ||||
GetSerializeSize(change_prototype_txout, SER_DISK, 0); | GetSerializeSize(change_prototype_txout); | ||||
// Get the fee rate to use effective values in coin selection | // Get the fee rate to use effective values in coin selection | ||||
CFeeRate nFeeRateNeeded = | CFeeRate nFeeRateNeeded = | ||||
GetMinimumFeeRate(*this, coinControl, g_mempool); | GetMinimumFeeRate(*this, coinControl, g_mempool); | ||||
nFeeRet = Amount::zero(); | nFeeRet = Amount::zero(); | ||||
bool pick_new_inputs = true; | bool pick_new_inputs = true; | ||||
Amount nValueIn = Amount::zero(); | Amount nValueIn = Amount::zero(); | ||||
Show All 32 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
fFirst = false; | fFirst = false; | ||||
txout.nValue -= nFeeRet % int(nSubtractFeeFromAmount); | txout.nValue -= nFeeRet % int(nSubtractFeeFromAmount); | ||||
} | } | ||||
} | } | ||||
// Include the fee cost for outputs. Note this is only used for | // Include the fee cost for outputs. Note this is only used for | ||||
// BnB right now | // BnB right now | ||||
coin_selection_params.tx_noinputs_size += | coin_selection_params.tx_noinputs_size += | ||||
::GetSerializeSize(txout, SER_NETWORK, PROTOCOL_VERSION); | ::GetSerializeSize(txout, PROTOCOL_VERSION); | ||||
if (IsDust(txout, dustRelayFee)) { | if (IsDust(txout, dustRelayFee)) { | ||||
if (recipient.fSubtractFeeFromAmount && | if (recipient.fSubtractFeeFromAmount && | ||||
nFeeRet > Amount::zero()) { | nFeeRet > Amount::zero()) { | ||||
if (txout.nValue < Amount::zero()) { | if (txout.nValue < Amount::zero()) { | ||||
strFailReason = _("The transaction amount is " | strFailReason = _("The transaction amount is " | ||||
"too small to pay the fee"); | "too small to pay the fee"); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 1,821 Lines • Show Last 20 Lines |