create INSTANTSEND_MIN_FEE to manage IS fee in one place (#829)

This commit is contained in:
UdjinM6 2016-05-30 10:22:15 +04:00 committed by Holger Schinzel
parent 9745914c15
commit f5e3042b7a
4 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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<uint256, CTransaction> mapTxLockReq;
extern map<uint256, CTransaction> mapTxLockReqRejected;

View File

@ -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());

View File

@ -2797,7 +2797,7 @@ bool CWallet::ConvertList(std::vector<CTxIn> vCoins, std::vector<CAmount>& vecAm
bool CWallet::CreateTransaction(const vector<CRecipient>& 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;