mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 15:22:38 +02:00
rpc: Add specific error code for "wallet already loaded"
This commit is contained in:
@ -304,12 +304,12 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||
if self.options.descriptors:
|
||||
assert_raises_rpc_error(-4, "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?", self.nodes[0].loadwallet, wallet_names[0])
|
||||
else:
|
||||
assert_raises_rpc_error(-4, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, wallet_names[0])
|
||||
assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, wallet_names[0])
|
||||
|
||||
# This tests the default wallet that BDB makes, so SQLite wallet doesn't need to test this
|
||||
# Fail to load duplicate wallets by different ways (directory and filepath)
|
||||
path = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets", "wallet.dat")
|
||||
assert_raises_rpc_error(-4, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, 'wallet.dat')
|
||||
assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, 'wallet.dat')
|
||||
|
||||
# Only BDB doesn't open duplicate wallet files. SQLite does not have this limitation. While this may be desired in the future, it is not necessary
|
||||
# Fail to load if one wallet is a copy of another
|
||||
|
Reference in New Issue
Block a user