mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Introduce wrappers around CBitcoinAddress
This patch removes the need for the intermediary Base58 type
CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination
function that directly operate on the conversion between strings
and CTxDestination.
This commit is contained in:
@@ -777,19 +777,18 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text)
|
||||
CoinControlDialog::coinControl->destChange = CNoDestination();
|
||||
ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
|
||||
|
||||
CBitcoinAddress addr = CBitcoinAddress(text.toStdString());
|
||||
const CTxDestination dest = DecodeDestination(text.toStdString());
|
||||
|
||||
if (text.isEmpty()) // Nothing entered
|
||||
{
|
||||
ui->labelCoinControlChangeLabel->setText("");
|
||||
}
|
||||
else if (!addr.IsValid()) // Invalid address
|
||||
else if (!IsValidDestination(dest)) // Invalid address
|
||||
{
|
||||
ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid Bitcoin address"));
|
||||
}
|
||||
else // Valid address
|
||||
{
|
||||
const CTxDestination dest = addr.Get();
|
||||
if (!model->IsSpendable(dest)) {
|
||||
ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user