Skip to content

Commit ef0e5cd

Browse files
author
MarcoFalke
committed
Merge #13251: GUI: Rephrase Bech32 checkbox texts, and enable it with legacy address default
82dda6b GUI: Allow generating Bech32 addresses with a legacy-address default (Luke Dashjr) 7ab1c6f 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
2 parents 4cfe17c + 82dda6b commit ef0e5cd

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/qt/forms/receivecoinsdialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@
206206
<enum>Qt::StrongFocus</enum>
207207
</property>
208208
<property name="toolTip">
209-
<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>
209+
<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>
210210
</property>
211211
<property name="text">
212-
<string>Generate Bech32 address</string>
212+
<string>Generate native segwit (Bech32) address</string>
213213
</property>
214214
</widget>
215215
</item>

src/qt/receivecoinsdialog.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,11 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
9494
// Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.
9595
columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);
9696

97-
// configure bech32 checkbox, disable if launched with legacy as default:
9897
if (model->wallet().getDefaultAddressType() == OutputType::BECH32) {
9998
ui->useBech32->setCheckState(Qt::Checked);
10099
} else {
101100
ui->useBech32->setCheckState(Qt::Unchecked);
102101
}
103-
104-
ui->useBech32->setVisible(model->wallet().getDefaultAddressType() != OutputType::LEGACY);
105102
}
106103
}
107104

@@ -144,9 +141,14 @@ void ReceiveCoinsDialog::on_receiveButton_clicked()
144141
QString address;
145142
QString label = ui->reqLabel->text();
146143
/* Generate new receiving address */
147-
OutputType address_type = model->wallet().getDefaultAddressType();
148-
if (address_type != OutputType::LEGACY) {
149-
address_type = ui->useBech32->isChecked() ? OutputType::BECH32 : OutputType::P2SH_SEGWIT;
144+
OutputType address_type;
145+
if (ui->useBech32->isChecked()) {
146+
address_type = OutputType::BECH32;
147+
} else {
148+
address_type = model->wallet().getDefaultAddressType();
149+
if (address_type == OutputType::BECH32) {
150+
address_type = OutputType::P2SH_SEGWIT;
151+
}
150152
}
151153
address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "", address_type);
152154
SendCoinsRecipient info(address, label,

0 commit comments

Comments
 (0)