diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-07-30 14:02:03 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-07-30 13:53:21 -0400 |
commit | fa5a4cd813c2f0225dcbc05cd16ae2d1c0d13234 (patch) | |
tree | 8ec8d33c3033873359cfa1c4e638c137845a0b17 /src/qt/receivecoinsdialog.cpp | |
parent | 74f1a27f2f45af7dafcc34df766cf76d29c7c6ed (diff) |
gui: Generate bech32 addresses by default (take 2, fixup)
Diffstat (limited to 'src/qt/receivecoinsdialog.cpp')
-rw-r--r-- | src/qt/receivecoinsdialog.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index c58717e21e..05157c2a4a 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -7,6 +7,7 @@ #include <qt/receivecoinsdialog.h> #include <qt/forms/ui_receivecoinsdialog.h> +#include <interfaces/node.h> #include <qt/addresstablemodel.h> #include <qt/optionsmodel.h> #include <qt/platformstyle.h> @@ -92,10 +93,16 @@ 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); - if (model->wallet().getDefaultAddressType() == OutputType::BECH32) { - ui->useLegacyAddress->setCheckState(Qt::Unchecked); + if (model->node().isAddressTypeSet()) { + // user explicitly set the type, use it + if (model->wallet().getDefaultAddressType() == OutputType::BECH32) { + ui->useLegacyAddress->setCheckState(Qt::Unchecked); + } else { + ui->useLegacyAddress->setCheckState(Qt::Checked); + } } else { - ui->useLegacyAddress->setCheckState(Qt::Checked); + // Always fall back to bech32 in the gui + ui->useLegacyAddress->setCheckState(Qt::Unchecked); } // Set the button to be enabled or disabled based on whether the wallet can give out new addresses. |