src/qt/sendcoinsdialog.cpp
// Coin Control: custom change address changed
Coin Control: custom change address changed
Coin Control : custom change address changed
void SendCoinsDialog::coinControlChangeEdited(const QString& text)
{
    if (model && model->getAddressTableModel())
    {
        CoinControlDialog::coinControl->destChange = CNoDestination();
        ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
        CBitcoinAddress addr = CBitcoinAddress(text.toStdString());
        if (text.isEmpty()) 
        {
            ui->labelCoinControlChangeLabel->setText("");
        }
        else if (!addr.IsValid()) 
        {
            ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid address"));
        }
        else 
        {
            CKeyID keyid;
            addr.GetKeyID(keyid);
            if (!model->havePrivKey(keyid)) 
            {
                ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
                QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm custom change address"), tr("The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?"),
                    QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
                if(btnRetVal == QMessageBox::Yes)
                    CoinControlDialog::coinControl->destChange = addr.Get();
                else
                {
                    ui->lineEditCoinControlChange->setText("");
                    ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:black;}");
                    ui->labelCoinControlChangeLabel->setText("");
                }
            }
            else 
            {
                ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:black;}");
                QString associatedLabel = model->getAddressTableModel()->labelForAddress(text);
                if (!associatedLabel.isEmpty())
                    ui->labelCoinControlChangeLabel->setText(associatedLabel);
                else
                    ui->labelCoinControlChangeLabel->setText(tr("(no label)"));
                CoinControlDialog::coinControl->destChange = addr.Get();
            }
        }
    }
}
void SendCoinsDialog :: coinControlChangeEdited ( const QString & text ) { if ( model && model -> getAddressTableModel ( ) ) { CoinControlDialog :: coinControl -> destChange = CNoDestination ( ) ; ui -> labelCoinControlChangeLabel -> setStyleSheet ( " " ) ; CBitcoinAddress addr = CBitcoinAddress ( text . toStdString ( ) ) ; if ( text . isEmpty ( ) ) { ui -> labelCoinControlChangeLabel -> setText ( " " ) ; } else if ( ! addr . IsValid ( ) ) { ui -> labelCoinControlChangeLabel -> setText ( tr ( " " ) ) ; } else { CKeyID keyid ; addr . GetKeyID ( keyid ) ; if ( ! model -> havePrivKey ( keyid ) ) { ui -> labelCoinControlChangeLabel -> setText ( tr ( " " ) ) ; QMessageBox :: StandardButton btnRetVal = QMessageBox :: question ( this , tr ( " " ) , tr ( " " ) , QMessageBox :: Yes | QMessageBox :: Cancel , QMessageBox :: Cancel ) ; if ( btnRetVal == QMessageBox :: Yes ) CoinControlDialog :: coinControl -> destChange = addr . Get ( ) ; else { ui -> lineEditCoinControlChange -> setText ( " " ) ; ui -> labelCoinControlChangeLabel -> setStyleSheet ( " " ) ; ui -> labelCoinControlChangeLabel -> setText ( " " ) ; } } else { ui -> labelCoinControlChangeLabel -> setStyleSheet ( " " ) ; QString associatedLabel = model -> getAddressTableModel ( ) -> labelForAddress ( text ) ; if ( ! associatedLabel . isEmpty ( ) ) ui -> labelCoinControlChangeLabel -> setText ( associatedLabel ) ; else ui -> labelCoinControlChangeLabel -> setText ( tr ( " " ) ) ; CoinControlDialog :: coinControl -> destChange = addr . Get ( ) ; } } } }
Coin Control: custom change address changed
Coin Control : custom change address changed
// Default to no change address until verified // Nothing entered // Invalid address // Valid address // Unknown change address // confirmation dialog // Known change address // Query label