wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory.

Github-Pull: #14552
Rebased-From: 15c93f0
This commit is contained in:
Chun Kuan Lee
2018-10-23 13:26:27 +08:00
committed by João Barbosa
parent 34da2b7c76
commit caf1146b13
4 changed files with 28 additions and 7 deletions

View File

@@ -217,6 +217,9 @@ class MultiWalletTest(BitcoinTestFramework):
# Fail to load duplicate wallets
assert_raises_rpc_error(-4, 'Wallet file verification failed: Error loading wallet w1. Duplicate -wallet filename specified.', self.nodes[0].loadwallet, wallet_names[0])
# Fail to load duplicate wallets by different ways (directory and filepath)
assert_raises_rpc_error(-4, "Wallet file verification failed: Error loading wallet wallet.dat. Duplicate -wallet filename specified.", self.nodes[0].loadwallet, 'wallet.dat')
# Fail to load if one wallet is a copy of another
assert_raises_rpc_error(-1, "BerkeleyBatch: Can't open database w8_copy (duplicates fileid", self.nodes[0].loadwallet, 'w8_copy')