aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-21 18:55:20 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-11-04 12:16:57 -0500
commit5f9c0b6360215636cfa62a70d3a70f1feb3977ab (patch)
tree07ba8b0642de2f84c2f036bfe31d2f3ac5687216
parenta314271f08215feba53ead27096ac7fda34acb3c (diff)
downloadbitcoin-5f9c0b6360215636cfa62a70d3a70f1feb3977ab.tar.xz
wallet: Remove -upgradewallet from dummywallet
-rw-r--r--src/dummywallet.cpp1
-rw-r--r--src/wallet/wallet.cpp3
-rwxr-xr-xtest/functional/wallet_multiwallet.py3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/dummywallet.cpp b/src/dummywallet.cpp
index 8d2dcd0279..4543f098a1 100644
--- a/src/dummywallet.cpp
+++ b/src/dummywallet.cpp
@@ -40,7 +40,6 @@ void DummyWalletInit::AddWalletOptions(ArgsManager& argsman) const
"-salvagewallet",
"-spendzeroconfchange",
"-txconfirmtarget=<n>",
- "-upgradewallet",
"-wallet=<path>",
"-walletbroadcast",
"-walletdir=<dir>",
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index be7b30009c..11ce0d0c05 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4100,8 +4100,7 @@ const CAddressBookData* CWallet::FindAddressBookEntry(const CTxDestination& dest
bool CWallet::UpgradeWallet(int version, bilingual_str& error, std::vector<bilingual_str>& warnings)
{
int prev_version = GetVersion();
- if (version == 0) // the -upgradewallet without argument case
- {
+ if (version == 0) {
WalletLogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
version = FEATURE_LATEST;
} else {
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py
index 61791a756c..ab3edbd04c 100755
--- a/test/functional/wallet_multiwallet.py
+++ b/test/functional/wallet_multiwallet.py
@@ -139,6 +139,9 @@ class MultiWalletTest(BitcoinTestFramework):
open(not_a_dir, 'a', encoding="utf8").close()
self.nodes[0].assert_start_raises_init_error(['-walletdir=' + not_a_dir], 'Error: Specified -walletdir "' + not_a_dir + '" is not a directory')
+ self.log.info("Do not allow -upgradewallet with multiwallet")
+ self.nodes[0].assert_start_raises_init_error(['-upgradewallet'], "Error: Error parsing command line arguments: Invalid parameter -upgradewallet")
+
# if wallets/ doesn't exist, datadir should be the default wallet dir
wallet_dir2 = data_dir('walletdir')
os.rename(wallet_dir(), wallet_dir2)