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 BitRadio address"));
        } else 
        {
            CPubKey pubkey;
            CKeyID keyid;
            addr.GetKeyID(keyid);
            if (!model->getPubKey(keyid, pubkey)) 
            {
                ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
            } 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 { CPubKey pubkey ; CKeyID keyid ; addr . GetKeyID ( keyid ) ; if ( ! model -> getPubKey ( keyid , pubkey ) ) { ui -> labelCoinControlChangeLabel -> setText ( tr ( " " ) ) ; } 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 // Known change address // Query label