diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-09-05 15:59:47 -0700 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-09-05 16:00:37 -0700 |
commit | a31e9ad4f027955d43c04a05517244647e250161 (patch) | |
tree | bc289dacc19c134f4e4c9778501c65b6bf517288 /src/qt/sendcoinsdialog.cpp | |
parent | 777519bd96f68c18150a0f5942f8f97a91937f5e (diff) | |
parent | a1ea1cfbd8d4fc976f0ab2423d395e03ded6eedd (diff) |
Merge #11247: qt: Use IsMine to validate custom change address
a1ea1cfbd qt: Use IsMine to validate custom change address (Chris Moore)
Pull request description:
Fixes #11137
Closes #11184 (which was accidentally opened against 0.15 branch)
Tree-SHA512: a20a59b4f36c1471a9c84bcc7c69048576d1f413104c299a7ed9ba221f28eddf93d727fca2926420ea5d0dd9aba582924f26a5acd44d995039b7202c73eb53bc
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 625e435742..a056e858a7 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -789,10 +789,8 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) } else // Valid address { - CKeyID keyid; - addr.GetKeyID(keyid); - if (!model->havePrivKey(keyid)) // Unknown change address - { + const CTxDestination dest = addr.Get(); + if (!model->IsSpendable(dest)) { ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address")); // confirmation dialog @@ -800,7 +798,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if(btnRetVal == QMessageBox::Yes) - CoinControlDialog::coinControl->destChange = addr.Get(); + CoinControlDialog::coinControl->destChange = dest; else { ui->lineEditCoinControlChange->setText(""); @@ -819,7 +817,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) else ui->labelCoinControlChangeLabel->setText(tr("(no label)")); - CoinControlDialog::coinControl->destChange = addr.Get(); + CoinControlDialog::coinControl->destChange = dest; } } } |