mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
[wallet] [tests] Test disallowed multiwallet params
Add a test to check that bitcoind fails to start when specifying -zapwallettxes, -salvagewallet and -upgradewallet when running in multiwallet mode.
This commit is contained in:
parent
3476e3c48b
commit
1f838394bf
@ -91,6 +91,19 @@ class MultiWalletTest(BitcoinTestFramework):
|
|||||||
open(not_a_dir, 'a').close()
|
open(not_a_dir, 'a').close()
|
||||||
self.nodes[0].assert_start_raises_init_error(['-walletdir=' + not_a_dir], 'Error: Specified -walletdir "' + not_a_dir + '" is not a directory')
|
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 -zapwallettxes with multiwallet")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-zapwallettxes', '-wallet=w1', '-wallet=w2'], "Error: -zapwallettxes is only allowed with a single wallet file")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-zapwallettxes=1', '-wallet=w1', '-wallet=w2'], "Error: -zapwallettxes is only allowed with a single wallet file")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-zapwallettxes=2', '-wallet=w1', '-wallet=w2'], "Error: -zapwallettxes is only allowed with a single wallet file")
|
||||||
|
|
||||||
|
self.log.info("Do not allow -salvagewallet with multiwallet")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-salvagewallet', '-wallet=w1', '-wallet=w2'], "Error: -salvagewallet is only allowed with a single wallet file")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-salvagewallet=1', '-wallet=w1', '-wallet=w2'], "Error: -salvagewallet is only allowed with a single wallet file")
|
||||||
|
|
||||||
|
self.log.info("Do not allow -upgradewallet with multiwallet")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-upgradewallet', '-wallet=w1', '-wallet=w2'], "Error: -upgradewallet is only allowed with a single wallet file")
|
||||||
|
self.nodes[0].assert_start_raises_init_error(['-upgradewallet=1', '-wallet=w1', '-wallet=w2'], "Error: -upgradewallet is only allowed with a single wallet file")
|
||||||
|
|
||||||
# if wallets/ doesn't exist, datadir should be the default wallet dir
|
# if wallets/ doesn't exist, datadir should be the default wallet dir
|
||||||
wallet_dir2 = data_dir('walletdir')
|
wallet_dir2 = data_dir('walletdir')
|
||||||
os.rename(wallet_dir(), wallet_dir2)
|
os.rename(wallet_dir(), wallet_dir2)
|
||||||
|
Loading…
Reference in New Issue
Block a user