Skip to content

Commit

Permalink
[GUI] Warn about change address not belonging to the wallet.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Apr 14, 2020
1 parent ab353d9 commit acdccc5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/qt/pivx/send.cpp
Expand Up @@ -590,7 +590,14 @@ void SendWidget::onChangeAddressClicked()
if (dialog->selected) {
QString ret;
if (dialog->getAddress(walletModel, &ret)) {
CoinControlDialog::coinControl->destChange = CBitcoinAddress(ret.toStdString()).Get();
CBitcoinAddress address(ret.toStdString());

// Ask if it's what the user really wants
if (!walletModel->isMine(address) &&
!ask(tr("Warning!"), tr("The change address doesn't belong to this wallet.\n\nDo you want to continue?"))) {
return;
}
CoinControlDialog::coinControl->destChange = address.Get();
ui->btnChangeAddress->setActive(true);
} else {
inform(tr("Invalid change address"));
Expand Down

0 comments on commit acdccc5

Please sign in to comment.