Skip to content

Commit

Permalink
Merge pull request #227 from Jongjan88/descriptor77
Browse files Browse the repository at this point in the history
  • Loading branch information
gto90 authored Apr 5, 2024
2 parents 527219d + 6ba42bd commit 99ed14a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
7 changes: 0 additions & 7 deletions src/qt/createwalletdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
ui->encrypt_wallet_checkbox->setEnabled(!checked);
ui->blank_wallet_checkbox->setEnabled(!checked);
ui->disable_privkeys_checkbox->setEnabled(!checked);
ui->descriptor_checkbox->setEnabled(!checked);

// The external signer checkbox is only enabled when a device is detected.
// In that case it is checked by default. Toggling it restores the other
// options to their default.
ui->descriptor_checkbox->setChecked(checked);
ui->encrypt_wallet_checkbox->setChecked(false);
ui->disable_privkeys_checkbox->setChecked(checked);
// The blank check box is ambiguous. This flag is always true for a
Expand Down Expand Up @@ -153,11 +151,6 @@ bool CreateWalletDialog::isMakeBlankWalletChecked() const
return ui->blank_wallet_checkbox->isChecked();
}

bool CreateWalletDialog::isDescriptorWalletChecked() const
{
return ui->descriptor_checkbox->isChecked();
}

bool CreateWalletDialog::isExternalSignerChecked() const
{
return ui->external_signer_checkbox->isChecked();
Expand Down
13 changes: 0 additions & 13 deletions src/qt/forms/createwalletdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="descriptor_checkbox">
<property name="toolTip">
<string>Use descriptors for scriptPubKey management</string>
</property>
<property name="text">
<string>Descriptor Wallet</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="external_signer_checkbox">
<property name="toolTip">
Expand Down
4 changes: 1 addition & 3 deletions src/qt/walletcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,13 @@ void CreateWalletActivity::createWallet()

std::string name = m_create_wallet_dialog->walletName().toStdString();
uint64_t flags = 0;
flags |= WALLET_FLAG_DESCRIPTORS;
if (m_create_wallet_dialog->isDisablePrivateKeysChecked()) {
flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS;
}
if (m_create_wallet_dialog->isMakeBlankWalletChecked()) {
flags |= WALLET_FLAG_BLANK_WALLET;
}
if (m_create_wallet_dialog->isDescriptorWalletChecked()) {
flags |= WALLET_FLAG_DESCRIPTORS;
}
if (m_create_wallet_dialog->isExternalSignerChecked()) {
flags |= WALLET_FLAG_EXTERNAL_SIGNER;
}
Expand Down
11 changes: 6 additions & 5 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ std::shared_ptr<CWallet> LoadWalletInternal(interfaces::Chain& chain, const std:
status = DatabaseStatus::FAILED_LOAD;
return nullptr;
}

// Legacy wallets are being deprecated, warn if the loaded wallet is legacy
if (!wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
warnings.push_back(_("The legacy wallet type is being deprecated and support for opening legacy wallets will be removed in the future."));
}

AddWallet(wallet);
wallet->postInitProcess();

Expand Down Expand Up @@ -342,11 +348,6 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, const std::strin
// Write the wallet settings
UpdateWalletSetting(chain, name, load_on_start, warnings);

// Legacy wallets are being deprecated, warn if a newly created wallet is legacy
if (!(wallet_creation_flags & WALLET_FLAG_DESCRIPTORS)) {
warnings.push_back(_("Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."));
}

status = DatabaseStatus::SUCCESS;
return wallet;
}
Expand Down

0 comments on commit 99ed14a

Please sign in to comment.