diff options
author | John Newbery <john@johnnewbery.com> | 2018-06-28 13:36:28 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-06-28 13:37:44 -0400 |
commit | ea65182f033eca73c291057dacd54f8e4e809fbd (patch) | |
tree | 08c1bf08e151037ce8a35f5eefa0665b7ae72719 /test | |
parent | d96bdd78307bc5469cb8a4d5ca0e6cbc21fe4073 (diff) | |
download | bitcoin-ea65182f033eca73c291057dacd54f8e4e809fbd.tar.xz |
[wallet] loadwallet shouldn't create new wallets.
A bug in the initial implementation of loadwallet meant that if the
arguement was a directory that didn't contain a wallet.dat file, a new
wallet would be created in that directory. Fix that so that if a
directory is passed in, it must contain a wallet.dat file.
Bug reported by promag (João Barbosa).
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/wallet_multiwallet.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 3cefd83459..fa5a2154a4 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -211,6 +211,10 @@ class MultiWalletTest(BitcoinTestFramework): # Fail to load if wallet file is a symlink assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink') + # Fail to load if a directory is specified that doesn't contain a wallet + os.mkdir(wallet_dir('empty_wallet_dir')) + assert_raises_rpc_error(-18, "Directory empty_wallet_dir does not contain a wallet.dat file", self.nodes[0].loadwallet, 'empty_wallet_dir') + self.log.info("Test dynamic wallet creation.") # Fail to create a wallet if it already exists. |