From f5e3042b7acd676247f7f8b0cb80e765dd145b4e Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 30 May 2016 10:22:15 +0400 Subject: [PATCH] create INSTANTSEND_MIN_FEE to manage IS fee in one place (#829) --- src/instantx.cpp | 2 +- src/instantx.h | 1 + src/qt/coincontroldialog.cpp | 4 ++-- src/wallet/wallet.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/instantx.cpp b/src/instantx.cpp index 8fa870b1dc..2787020a36 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -207,7 +207,7 @@ bool IsIXTXValid(const CTransaction& txCollateral){ return true; } - if(nValueIn-nValueOut < CENT) { + if(nValueIn-nValueOut < INSTANTSEND_MIN_FEE) { LogPrint("instantsend", "IsIXTXValid - did not include enough fees in transaction %d\n%s\n", nValueOut-nValueIn, txCollateral.ToString()); return false; } diff --git a/src/instantx.h b/src/instantx.h index 6384081140..b637debccf 100644 --- a/src/instantx.h +++ b/src/instantx.h @@ -33,6 +33,7 @@ class CTransaction; class CTransactionLock; static const int MIN_INSTANTX_PROTO_VERSION = 70103; +static const CAmount INSTANTSEND_MIN_FEE = 1 * CENT; extern map mapTxLockReq; extern map mapTxLockReqRejected; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index c9163851eb..e708008379 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -606,8 +606,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) if (nPayFee > 0 && coinControl->nMinimumTotalFee > nPayFee) nPayFee = coinControl->nMinimumTotalFee; - // IX Fee - if(coinControl->useInstantX) nPayFee = max(nPayFee, CENT); + // InstantSend Fee + if(coinControl->useInstantX) nPayFee = max(nPayFee, INSTANTSEND_MIN_FEE); // Allow free? (require at least hard-coded threshold and default to that if no estimate) double dPriorityNeeded = std::max(mempoolEstimatePriority, AllowFreeThreshold()); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b69d952281..045a62048b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2797,7 +2797,7 @@ bool CWallet::ConvertList(std::vector vCoins, std::vector& vecAm bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosRet, std::string& strFailReason, const CCoinControl* coinControl, bool sign, AvailableCoinsType coin_type, bool useIX) { - CAmount nFeePay = useIX ? CENT : 0; + CAmount nFeePay = useIX ? INSTANTSEND_MIN_FEE : 0; CAmount nValue = 0; unsigned int nSubtractFeeFromAmount = 0;