From 454154c18fe75797bf13f13ab87a5396cb369a69 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Wed, 4 Feb 2015 04:56:56 -0700 Subject: [PATCH] fixed min IX fee --- src/qt/sendcoinsdialog.cpp | 1 + src/wallet.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index a8040bcff2..c0b2bc9bb4 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -47,6 +47,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int))); connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &))); connect(ui->checkUseDarksend, SIGNAL(stateChanged ( int )), this, SLOT(updateDisplayUnit())); + connect(ui->checkInstantX, SIGNAL(stateChanged ( int )), this, SLOT(updateDisplayUnit())); // Coin Control: clipboard actions QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this); diff --git a/src/wallet.cpp b/src/wallet.cpp index df4fa58273..ba4d853fe4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1873,9 +1873,6 @@ bool CWallet::CreateTransaction(const vector >& vecSend, dPriority += (double)nCredit * (pcoin.first->GetDepthInMainChain()+1); } - // IX has a minimum fee of 0.01 DRK - if(useIX && nFeeRet < COIN*0.01 ) nFeeRet = COIN*0.01; - int64_t nChange = nValueIn - nValue - nFeeRet; // The following if statement should be removed once enough miners @@ -1893,6 +1890,10 @@ bool CWallet::CreateTransaction(const vector >& vecSend, if(coin_type == ONLY_DENOMINATED) { nFeeRet = nChange; nChange = 0; + } else if(useIX && nFeeRet < COIN*0.01 && nChange > ((COIN*0.01)-nFeeRet)) { + // IX has a minimum fee of 0.01 DRK + nChange -= (COIN*0.01)-nFeeRet; + nFeeRet = COIN*0.01; } if (nChange > 0)