Skip to content

Commit ae1cc01

Browse files
author
MarcoFalke
committed
Merge #14282: [wallet] Remove -usehd
7ac911a [docs] Add release notes for removing `-usehd` (John Newbery) 25548b2 [wallet] Remove -usehd (John Newbery) Pull request description: `-usehd` is no longer used (except to tell the user that they've set it incorrectly for the wallet that they're loading). Remove it (in the same spirit as #14272) Tree-SHA512: 5bdcd2bb9bb8504a01343595bcd1bd433d97b730255152c725103c1ac3fa3a9d9e5220a4c29d4c72307cf803e1c09d31080f83603c23dc77263846e17b1826f0
2 parents d799efe + 7ac911a commit ae1cc01

File tree

5 files changed

+8
-22
lines changed

5 files changed

+8
-22
lines changed

doc/release-notes-14282.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Low-level RPC changes
2+
----------------------
3+
4+
`-usehd` was removed in version 0.16. From that version onwards, all new
5+
wallets created are hierarchical deterministic wallets. Version 0.18 makes
6+
specifying `-usehd` invalid config.

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void SetupServerArgs()
323323

324324
// Hidden Options
325325
std::vector<std::string> hidden_args = {"-h", "-help",
326-
"-dbcrashratio", "-forcecompactdb", "-usehd",
326+
"-dbcrashratio", "-forcecompactdb",
327327
// GUI args. These will be overwritten by SetupUIArgs for the GUI
328328
"-allowselfsignedrootcertificates", "-choosedatadir", "-lang=<lang>", "-min", "-resetguisettings", "-rootcertificates=<file>", "-splash", "-uiplatform"};
329329

src/wallet/wallet.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3989,10 +3989,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
39893989
if (fFirstRun)
39903990
{
39913991
// ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key
3992-
if (!gArgs.GetBoolArg("-usehd", true)) {
3993-
InitError(strprintf(_("Error creating %s: You can't create non-HD wallets with this version."), walletFile));
3994-
return nullptr;
3995-
}
39963992
walletInstance->SetMinVersion(FEATURE_LATEST);
39973993

39983994
if ((wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
@@ -4020,16 +4016,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
40204016
if (!walletInstance->mapKeys.empty() || !walletInstance->mapCryptedKeys.empty()) {
40214017
InitWarning(strprintf(_("Warning: Private keys detected in wallet {%s} with disabled private keys"), walletFile));
40224018
}
4023-
} else if (gArgs.IsArgSet("-usehd")) {
4024-
bool useHD = gArgs.GetBoolArg("-usehd", true);
4025-
if (walletInstance->IsHDEnabled() && !useHD) {
4026-
InitError(strprintf(_("Error loading %s: You can't disable HD on an already existing HD wallet"), walletFile));
4027-
return nullptr;
4028-
}
4029-
if (!walletInstance->IsHDEnabled() && useHD) {
4030-
InitError(strprintf(_("Error loading %s: You can't enable HD on an already existing non-HD wallet"), walletFile));
4031-
return nullptr;
4032-
}
40334019
}
40344020

40354021
if (!gArgs.GetArg("-addresstype", "").empty() && !ParseOutputType(gArgs.GetArg("-addresstype", ""), walletInstance->m_default_address_type)) {

test/functional/wallet_hd.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ def skip_test_if_missing_module(self):
2525
self.skip_if_no_wallet()
2626

2727
def run_test(self):
28-
# Make sure can't switch off usehd after wallet creation
29-
self.stop_node(1)
30-
self.nodes[1].assert_start_raises_init_error(['-usehd=0'], "Error: Error loading : You can't disable HD on an already existing HD wallet")
31-
self.start_node(1)
32-
connect_nodes_bi(self.nodes, 0, 1)
33-
3428
# Make sure we use hd, keep masterkeyid
3529
masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
3630
assert_equal(masterkeyid, self.nodes[1].getwalletinfo()['hdmasterkeyid'])

test/lint/check-doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
CMD_GREP_ARGS = r"git grep --perl-regexp '{}' -- {} ':(exclude){}'".format(REGEX_ARG, CMD_ROOT_DIR, FOLDER_TEST)
2323
CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR)
2424
# list unsupported, deprecated and duplicate args as they need no documentation
25-
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb', '-usehd'])
25+
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb'])
2626

2727

2828
def main():

0 commit comments

Comments
 (0)