diff options
| author | Pieter Wuille <[email protected]> | 2017-08-22 18:02:33 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-09-06 13:07:45 -0700 |
| commit | 5c8ff0d448ffdc6340b195ddfa2128d5f21a839b (patch) | |
| tree | 63a83a0708303a8d8382739c283bb41e07bdc5fe /src/qt/sendcoinsdialog.cpp | |
| parent | Merge #10596: Add vConnect to CConnman::Options (diff) | |
| download | discoin-5c8ff0d448ffdc6340b195ddfa2128d5f21a839b.tar.xz discoin-5c8ff0d448ffdc6340b195ddfa2128d5f21a839b.zip | |
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.
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
| -rw-r--r-- | src/qt/sendcoinsdialog.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index a056e858a..05c5ccbfe 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -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")); |