Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,926 Lines • ▼ Show 20 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
// Allow to override the default confirmation target over the | // Allow to override the default confirmation target over the | ||||
// CoinControl instance. | // CoinControl instance. | ||||
int currentConfirmationTarget = nTxConfirmTarget; | int currentConfirmationTarget = nTxConfirmTarget; | ||||
if (coinControl && coinControl->nConfirmTarget > 0) { | if (coinControl && coinControl->nConfirmTarget > 0) { | ||||
currentConfirmationTarget = coinControl->nConfirmTarget; | currentConfirmationTarget = coinControl->nConfirmTarget; | ||||
} | } | ||||
// Can we complete this as a free transaction? | |||||
if (fSendFreeTransactions && | |||||
nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE) { | |||||
// Not enough fee: enough priority? | |||||
double dPriorityNeeded = | |||||
mempool.estimateSmartPriority(currentConfirmationTarget); | |||||
// Require at least hard-coded AllowFree. | |||||
if (dPriority >= dPriorityNeeded && AllowFree(dPriority)) { | |||||
break; | |||||
} | |||||
} | |||||
Amount nFeeNeeded = | Amount nFeeNeeded = | ||||
GetMinimumFee(nBytes, currentConfirmationTarget, mempool); | GetMinimumFee(nBytes, currentConfirmationTarget, mempool); | ||||
if (coinControl && nFeeNeeded > Amount(0) && | if (coinControl && nFeeNeeded > Amount(0) && | ||||
coinControl->nMinimumTotalFee > nFeeNeeded) { | coinControl->nMinimumTotalFee > nFeeNeeded) { | ||||
nFeeNeeded = coinControl->nMinimumTotalFee; | nFeeNeeded = coinControl->nMinimumTotalFee; | ||||
} | } | ||||
if (coinControl && coinControl->fOverrideFeeRate) { | if (coinControl && coinControl->fOverrideFeeRate) { | ||||
▲ Show 20 Lines • Show All 1,629 Lines • Show Last 20 Lines |