mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #14282: [wallet] Remove -usehd
7ac911afe7
[docs] Add release notes for removing `-usehd` (John Newbery)25548b2958
[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
This commit is contained in:
commit
ae1cc010b8
5 changed files with 8 additions and 22 deletions
6
doc/release-notes-14282.md
Normal file
6
doc/release-notes-14282.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Low-level RPC changes
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
`-usehd` was removed in version 0.16. From that version onwards, all new
|
||||||
|
wallets created are hierarchical deterministic wallets. Version 0.18 makes
|
||||||
|
specifying `-usehd` invalid config.
|
|
@ -323,7 +323,7 @@ void SetupServerArgs()
|
||||||
|
|
||||||
// Hidden Options
|
// Hidden Options
|
||||||
std::vector<std::string> hidden_args = {"-h", "-help",
|
std::vector<std::string> hidden_args = {"-h", "-help",
|
||||||
"-dbcrashratio", "-forcecompactdb", "-usehd",
|
"-dbcrashratio", "-forcecompactdb",
|
||||||
// GUI args. These will be overwritten by SetupUIArgs for the GUI
|
// GUI args. These will be overwritten by SetupUIArgs for the GUI
|
||||||
"-allowselfsignedrootcertificates", "-choosedatadir", "-lang=<lang>", "-min", "-resetguisettings", "-rootcertificates=<file>", "-splash", "-uiplatform"};
|
"-allowselfsignedrootcertificates", "-choosedatadir", "-lang=<lang>", "-min", "-resetguisettings", "-rootcertificates=<file>", "-splash", "-uiplatform"};
|
||||||
|
|
||||||
|
|
|
@ -3989,10 +3989,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
|
||||||
if (fFirstRun)
|
if (fFirstRun)
|
||||||
{
|
{
|
||||||
// ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key
|
// ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key
|
||||||
if (!gArgs.GetBoolArg("-usehd", true)) {
|
|
||||||
InitError(strprintf(_("Error creating %s: You can't create non-HD wallets with this version."), walletFile));
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
walletInstance->SetMinVersion(FEATURE_LATEST);
|
walletInstance->SetMinVersion(FEATURE_LATEST);
|
||||||
|
|
||||||
if ((wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
|
if ((wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
|
||||||
|
@ -4020,16 +4016,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
|
||||||
if (!walletInstance->mapKeys.empty() || !walletInstance->mapCryptedKeys.empty()) {
|
if (!walletInstance->mapKeys.empty() || !walletInstance->mapCryptedKeys.empty()) {
|
||||||
InitWarning(strprintf(_("Warning: Private keys detected in wallet {%s} with disabled private keys"), walletFile));
|
InitWarning(strprintf(_("Warning: Private keys detected in wallet {%s} with disabled private keys"), walletFile));
|
||||||
}
|
}
|
||||||
} else if (gArgs.IsArgSet("-usehd")) {
|
|
||||||
bool useHD = gArgs.GetBoolArg("-usehd", true);
|
|
||||||
if (walletInstance->IsHDEnabled() && !useHD) {
|
|
||||||
InitError(strprintf(_("Error loading %s: You can't disable HD on an already existing HD wallet"), walletFile));
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
if (!walletInstance->IsHDEnabled() && useHD) {
|
|
||||||
InitError(strprintf(_("Error loading %s: You can't enable HD on an already existing non-HD wallet"), walletFile));
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gArgs.GetArg("-addresstype", "").empty() && !ParseOutputType(gArgs.GetArg("-addresstype", ""), walletInstance->m_default_address_type)) {
|
if (!gArgs.GetArg("-addresstype", "").empty() && !ParseOutputType(gArgs.GetArg("-addresstype", ""), walletInstance->m_default_address_type)) {
|
||||||
|
|
|
@ -25,12 +25,6 @@ class WalletHDTest(BitcoinTestFramework):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
# Make sure can't switch off usehd after wallet creation
|
|
||||||
self.stop_node(1)
|
|
||||||
self.nodes[1].assert_start_raises_init_error(['-usehd=0'], "Error: Error loading : You can't disable HD on an already existing HD wallet")
|
|
||||||
self.start_node(1)
|
|
||||||
connect_nodes_bi(self.nodes, 0, 1)
|
|
||||||
|
|
||||||
# Make sure we use hd, keep masterkeyid
|
# Make sure we use hd, keep masterkeyid
|
||||||
masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
|
masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
|
||||||
assert_equal(masterkeyid, self.nodes[1].getwalletinfo()['hdmasterkeyid'])
|
assert_equal(masterkeyid, self.nodes[1].getwalletinfo()['hdmasterkeyid'])
|
||||||
|
|
|
@ -22,7 +22,7 @@ CMD_ROOT_DIR = '`git rev-parse --show-toplevel`/{}'.format(FOLDER_GREP)
|
||||||
CMD_GREP_ARGS = r"git grep --perl-regexp '{}' -- {} ':(exclude){}'".format(REGEX_ARG, CMD_ROOT_DIR, FOLDER_TEST)
|
CMD_GREP_ARGS = r"git grep --perl-regexp '{}' -- {} ':(exclude){}'".format(REGEX_ARG, CMD_ROOT_DIR, FOLDER_TEST)
|
||||||
CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR)
|
CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR)
|
||||||
# list unsupported, deprecated and duplicate args as they need no documentation
|
# list unsupported, deprecated and duplicate args as they need no documentation
|
||||||
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb', '-usehd'])
|
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb'])
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Add table
Reference in a new issue