Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,042 Lines • ▼ Show 20 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
// Static vsize overhead + outputs vsize. 4 nVersion, 4 nLocktime, 1 | // Static vsize overhead + outputs vsize. 4 nVersion, 4 nLocktime, 1 | ||||
// input count, 1 output count | // input count, 1 output count | ||||
coin_selection_params.tx_noinputs_size = 10; | coin_selection_params.tx_noinputs_size = 10; | ||||
// vouts to the payees | // vouts to the payees | ||||
for (const auto &recipient : vecSend) { | for (const auto &recipient : vecSend) { | ||||
CTxOut txout(recipient.nAmount, recipient.scriptPubKey); | CTxOut txout(recipient.nAmount, recipient.scriptPubKey); | ||||
if (recipient.fSubtractFeeFromAmount) { | if (recipient.fSubtractFeeFromAmount) { | ||||
assert(nSubtractFeeFromAmount != 0); | |||||
// Subtract fee equally from each selected recipient. | // Subtract fee equally from each selected recipient. | ||||
txout.nValue -= nFeeRet / int(nSubtractFeeFromAmount); | txout.nValue -= nFeeRet / int(nSubtractFeeFromAmount); | ||||
// First receiver pays the remainder not divisible by output | // First receiver pays the remainder not divisible by output | ||||
// count. | // count. | ||||
if (fFirst) { | if (fFirst) { | ||||
fFirst = false; | fFirst = false; | ||||
txout.nValue -= nFeeRet % int(nSubtractFeeFromAmount); | txout.nValue -= nFeeRet % int(nSubtractFeeFromAmount); | ||||
▲ Show 20 Lines • Show All 1,715 Lines • Show Last 20 Lines |