diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2018-01-17 07:25:17 +0000 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-05-24 16:32:03 -0400 |
commit | 0eda98d01b6fef1309cdaf8365b752fed39d39a5 (patch) | |
tree | 85f31ae9c204ba84ef54f8ba4de14fc3fa9b8706 /src | |
parent | ea487f9f905b5971e686458b4687157c001b1119 (diff) |
GUI: Allow generating Bech32 addresses with a legacy-address default
Github-Pull: #13251
Rebased-From: 82dda6bed971c5638962442b4927845fe5eb6600
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/receivecoinsdialog.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 7fd5285467..e7c0079be2 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -94,14 +94,11 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model) // Last 2 columns are set by the columnResizingFixer, when the table geometry is ready. columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this); - // configure bech32 checkbox, disable if launched with legacy as default: if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) { ui->useBech32->setCheckState(Qt::Checked); } else { ui->useBech32->setCheckState(Qt::Unchecked); } - - ui->useBech32->setVisible(model->getDefaultAddressType() != OUTPUT_TYPE_LEGACY); } } @@ -144,9 +141,14 @@ void ReceiveCoinsDialog::on_receiveButton_clicked() QString address; QString label = ui->reqLabel->text(); /* Generate new receiving address */ - OutputType address_type = model->getDefaultAddressType(); - if (address_type != OUTPUT_TYPE_LEGACY) { - address_type = ui->useBech32->isChecked() ? OUTPUT_TYPE_BECH32 : OUTPUT_TYPE_P2SH_SEGWIT; + OutputType address_type; + if (ui->useBech32->isChecked()) { + address_type = OUTPUT_TYPE_BECH32; + } else { + address_type = model->getDefaultAddressType(); + if (address_type == OUTPUT_TYPE_BECH32) { + address_type = OUTPUT_TYPE_P2SH_SEGWIT; + } } address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "", address_type); SendCoinsRecipient info(address, label, |