Merge pull request #337 from UdjinM6/ds_coin_control

CoinControl should disable DS when non-anonymized inputs are selected
This commit is contained in:
evan82 2015-05-20 16:06:38 -07:00
commit 9e5542ac45
2 changed files with 12 additions and 1 deletions

View File

@ -385,8 +385,17 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
coinControl->UnSelect(outpt);
else if (item->isDisabled()) // locked (this happens if "check all" through parent node)
item->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
else
else {
coinControl->Select(outpt);
CTxIn vin(outpt);
int rounds = GetInputDarksendRounds(vin);
if(coinControl->useDarkSend && rounds < nDarksendRounds) {
QMessageBox::warning(this, windowTitle(),
tr("Non-anonymized input selected. <b>Darksend will be disabled.</b><br><br>If you still want to use Darksend, please deselect all non-nonymized inputs first and then check Darksend checkbox again."),
QMessageBox::Ok, QMessageBox::Ok);
coinControl->useDarkSend = false;
}
}
// selection changed -> update labels
if (ui->treeWidget->isEnabled()) // do not update on every click for (un)select all

View File

@ -684,6 +684,8 @@ void SendCoinsDialog::coinControlUpdateLabels()
CoinControlDialog::payAmounts.append(entry->getValue().amount);
}
ui->checkUseDarksend->setChecked(CoinControlDialog::coinControl->useDarkSend);
if (CoinControlDialog::coinControl->HasSelected())
{
// actual coin control calculation