aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-05-17 12:07:11 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-05-17 12:07:25 -0400
commitef0e5cd5174c1533bdb23787bffb9247f4abe381 (patch)
tree2b78e88793bcc8a572fff5c3cd38a55fe42671fc
parent4cfe17c3382ba750131cdc8703b2978132822070 (diff)
parent82dda6bed971c5638962442b4927845fe5eb6600 (diff)
Merge #13251: GUI: Rephrase Bech32 checkbox texts, and enable it with legacy address default
82dda6bed9 GUI: Allow generating Bech32 addresses with a legacy-address default (Luke Dashjr) 7ab1c6f6a7 GUI: Rephrase Bech32 checkbox text/tooltip (Luke Dashjr) Pull request description: - "Bech32" isn't very user-friendly; used "native segwit" as in #11937. - You don't spend from addresses. - No reason to block off Bech32 access with legacy address default. Rebased from #12208 Tree-SHA512: c82dd20d967a7f47bcc75b25be0d3a8cf00cfccc1cd14916b87d70b9c56fd53e366b456348b173f36c89b145b76624413780abaed4cea82117a9ecd47dd8fb99
-rw-r--r--src/qt/forms/receivecoinsdialog.ui4
-rw-r--r--src/qt/receivecoinsdialog.cpp14
2 files changed, 10 insertions, 8 deletions
diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui
index 09fb435a58..2f916d0b44 100644
--- a/src/qt/forms/receivecoinsdialog.ui
+++ b/src/qt/forms/receivecoinsdialog.ui
@@ -206,10 +206,10 @@
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
- <string>Bech32 addresses (BIP-173) are cheaper to spend from and offer better protection against typos. When unchecked a P2SH wrapped SegWit address will be created, compatible with older wallets.</string>
+ <string>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</string>
</property>
<property name="text">
- <string>Generate Bech32 address</string>
+ <string>Generate native segwit (Bech32) address</string>
</property>
</widget>
</item>
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index 70e11f0296..e458a52856 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->wallet().getDefaultAddressType() == OutputType::BECH32) {
ui->useBech32->setCheckState(Qt::Checked);
} else {
ui->useBech32->setCheckState(Qt::Unchecked);
}
-
- ui->useBech32->setVisible(model->wallet().getDefaultAddressType() != OutputType::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->wallet().getDefaultAddressType();
- if (address_type != OutputType::LEGACY) {
- address_type = ui->useBech32->isChecked() ? OutputType::BECH32 : OutputType::P2SH_SEGWIT;
+ OutputType address_type;
+ if (ui->useBech32->isChecked()) {
+ address_type = OutputType::BECH32;
+ } else {
+ address_type = model->wallet().getDefaultAddressType();
+ if (address_type == OutputType::BECH32) {
+ address_type = OutputType::P2SH_SEGWIT;
+ }
}
address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "", address_type);
SendCoinsRecipient info(address, label,