diff options
-rw-r--r-- | src/qt/forms/receivecoinsdialog.ui | 4 | ||||
-rw-r--r-- | src/qt/receivecoinsdialog.cpp | 14 | ||||
-rw-r--r-- | src/random.cpp | 5 | ||||
-rw-r--r-- | src/sync.cpp | 8 |
4 files changed, 18 insertions, 13 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, diff --git a/src/random.cpp b/src/random.cpp index 4ba86e4e7a..491272d5f3 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -11,14 +11,15 @@ #include <compat.h> // for Windows API #include <wincrypt.h> #endif -#include <util.h> // for LogPrint() -#include <utilstrencodings.h> // for GetTime() +#include <logging.h> // for LogPrint() +#include <utiltime.h> // for GetTime() #include <stdlib.h> #include <chrono> #include <thread> #ifndef WIN32 +#include <fcntl.h> #include <sys/time.h> #endif diff --git a/src/sync.cpp b/src/sync.cpp index 6f21d498ee..1f27aeb40b 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -4,13 +4,15 @@ #include <sync.h> -#include <memory> -#include <set> -#include <util.h> +#include <logging.h> #include <utilstrencodings.h> #include <stdio.h> +#include <map> +#include <memory> +#include <set> + #ifdef DEBUG_LOCKCONTENTION #if !defined(HAVE_THREAD_LOCAL) static_assert(false, "thread_local is not supported"); |