mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
qt: Use IsMine to validate custom change address
(cherry picked from commit c41224dfd5)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user