fixed min IX fee

This commit is contained in:
Evan Duffield 2015-02-04 04:56:56 -07:00
parent f811957208
commit 454154c18f
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -1873,9 +1873,6 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& 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<pair<CScript, int64_t> >& 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)