diff options
| author | Jonas Schnelli <[email protected]> | 2016-10-21 10:09:02 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-10-28 10:44:30 +0200 |
| commit | 004168dcb75750ea3f30e1349e4802c20bf4b860 (patch) | |
| tree | 4111b68b1d200d52ee99a602152716e82f51d6b7 /src/wallet/wallet.cpp | |
| parent | Merge #9029: instance of 'mem pool' to 'mempool' (diff) | |
| download | discoin-004168dcb75750ea3f30e1349e4802c20bf4b860.tar.xz discoin-004168dcb75750ea3f30e1349e4802c20bf4b860.zip | |
CoinControl: add option for custom confirmation target
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 60a769704..894da23cd 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2433,17 +2433,22 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt dPriority = wtxNew.ComputePriority(dPriority, nBytes); + // Allow to override the default confirmation target over the CoinControl instance + int currentConfirmationTarget = nTxConfirmTarget; + if (coinControl && coinControl->nConfirmTarget > 0) + 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(nTxConfirmTarget); + double dPriorityNeeded = mempool.estimateSmartPriority(currentConfirmationTarget); // Require at least hard-coded AllowFree. if (dPriority >= dPriorityNeeded && AllowFree(dPriority)) break; } - CAmount nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); + CAmount nFeeNeeded = GetMinimumFee(nBytes, currentConfirmationTarget, mempool); if (coinControl && nFeeNeeded > 0 && coinControl->nMinimumTotalFee > nFeeNeeded) { nFeeNeeded = coinControl->nMinimumTotalFee; } |