mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
gui: Generate bech32 addresses by default (take 2, fixup)
This commit is contained in:
parent
74f1a27f2f
commit
fa5a4cd813
3 changed files with 14 additions and 3 deletions
|
@ -198,6 +198,7 @@ public:
|
|||
return GuessVerificationProgress(Params().TxData(), tip);
|
||||
}
|
||||
bool isInitialBlockDownload() override { return ::ChainstateActive().IsInitialBlockDownload(); }
|
||||
bool isAddressTypeSet() override { return !::gArgs.GetArg("-addresstype", "").empty(); }
|
||||
bool getReindex() override { return ::fReindex; }
|
||||
bool getImporting() override { return ::fImporting; }
|
||||
void setNetworkActive(bool active) override
|
||||
|
|
|
@ -150,6 +150,9 @@ public:
|
|||
//! Is initial block download.
|
||||
virtual bool isInitialBlockDownload() = 0;
|
||||
|
||||
//! Is -addresstype set.
|
||||
virtual bool isAddressTypeSet() = 0;
|
||||
|
||||
//! Get reindex.
|
||||
virtual bool getReindex() = 0;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue