|
|
@ -41,7 +41,6 @@ CAmount maxTxFee = DEFAULT_TRANSACTION_MAXFEE; |
|
|
|
unsigned int nTxConfirmTarget = DEFAULT_TX_CONFIRM_TARGET; |
|
|
|
unsigned int nTxConfirmTarget = DEFAULT_TX_CONFIRM_TARGET; |
|
|
|
bool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE; |
|
|
|
bool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE; |
|
|
|
bool fSendFreeTransactions = DEFAULT_SEND_FREE_TRANSACTIONS; |
|
|
|
bool fSendFreeTransactions = DEFAULT_SEND_FREE_TRANSACTIONS; |
|
|
|
bool fPayAtLeastCustomFee = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) |
|
|
|
* Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) |
|
|
@ -2017,6 +2016,9 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CAmount nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); |
|
|
|
CAmount nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); |
|
|
|
|
|
|
|
if (coinControl && nFeeNeeded > 0 && coinControl->nMinimumTotalFee > nFeeNeeded) { |
|
|
|
|
|
|
|
nFeeNeeded = coinControl->nMinimumTotalFee; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If we made it here and we aren't even able to meet the relay fee on the next pass, give up
|
|
|
|
// If we made it here and we aren't even able to meet the relay fee on the next pass, give up
|
|
|
|
// because we must be at the maximum allowed fee.
|
|
|
|
// because we must be at the maximum allowed fee.
|
|
|
@ -2112,9 +2114,6 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge |
|
|
|
{ |
|
|
|
{ |
|
|
|
// payTxFee is user-set "I want to pay this much"
|
|
|
|
// payTxFee is user-set "I want to pay this much"
|
|
|
|
CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); |
|
|
|
CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); |
|
|
|
// user selected total at least (default=true)
|
|
|
|
|
|
|
|
if (fPayAtLeastCustomFee && nFeeNeeded > 0 && nFeeNeeded < payTxFee.GetFeePerK()) |
|
|
|
|
|
|
|
nFeeNeeded = payTxFee.GetFeePerK(); |
|
|
|
|
|
|
|
// User didn't set: use -txconfirmtarget to estimate...
|
|
|
|
// User didn't set: use -txconfirmtarget to estimate...
|
|
|
|
if (nFeeNeeded == 0) { |
|
|
|
if (nFeeNeeded == 0) { |
|
|
|
int estimateFoundTarget = nConfirmTarget; |
|
|
|
int estimateFoundTarget = nConfirmTarget; |
|
|
|