aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-07-07 06:06:41 -1100
committerMarcoFalke <falke.marco@gmail.com>2018-07-07 06:07:41 -1100
commit88a15ebc8d317a6fd4851adb344ff944d497284c (patch)
tree36c9ea2eb936e64b0c270b1cc31c2004f0111cdb /test
parent0212187fc624ea4a02fc99bc57ebd413499a9ee1 (diff)
parentea65182f033eca73c291057dacd54f8e4e809fbd (diff)
downloadbitcoin-88a15ebc8d317a6fd4851adb344ff944d497284c.tar.xz
Merge #13564: [wallet] loadwallet shouldn't create new wallets.
ea65182f03 [wallet] loadwallet shouldn't create new wallets. (John Newbery) Pull request description: 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). Tree-SHA512: 0a59fa8a33fde51a88544ad288b00e4995284fe16424f643076aaba42b8244fff362145217650ee53d518dfab7efbed4237632c34cdd3dcbbecaa9ecaab5fd7b
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/wallet_multiwallet.py4
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.