Skip to content

Commit 25548b2

Browse files
committed
[wallet] Remove -usehd
1 parent 9a3a984 commit 25548b2

File tree

4 files changed

+2
-22
lines changed

4 files changed

+2
-22
lines changed

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
@@ -3987,10 +3987,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
39873987
if (fFirstRun)
39883988
{
39893989
// ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key
3990-
if (!gArgs.GetBoolArg("-usehd", true)) {
3991-
InitError(strprintf(_("Error creating %s: You can't create non-HD wallets with this version."), walletFile));
3992-
return nullptr;
3993-
}
39943990
walletInstance->SetMinVersion(FEATURE_LATEST);
39953991

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

40334019
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)