mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
create INSTANTSEND_MIN_FEE to manage IS fee in one place (#829)
This commit is contained in:
parent
9745914c15
commit
f5e3042b7a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user