in the first commit:
The test passes without this change, so I am still wondering why this is needed.
Also, the commit doesn't seem to be exhaustive. The wallet.dat/bad should be replaced as well. Also, the usages in tool_wallet.py. See the diff I used for testing:
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index bd1d114730..89d7325e1c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -20,6 +20,6 @@ void SplitWalletPath(const fs::path& wallet_path, fs::path& env_directory, std::
// Normal case: Interpret wallet path as a directory path containing
// data and log files.
env_directory = wallet_path;
- database_filename = "wallet.dat";
+ database_filename = "wallet_dat";
}
}
diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp
index 8f0083cd2e..3489d48879 100644
--- a/src/wallet/test/db_tests.cpp
+++ b/src/wallet/test/db_tests.cpp
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
BOOST_AUTO_TEST_CASE(getwalletenv_directory)
{
- std::string expected_name = "wallet.dat";
+ std::string expected_name = "wallet_dat";
const fs::path datadir = GetDataDir();
std::string filename;
diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp
index e4c72aed98..3a16cb3e75 100644
--- a/src/wallet/walletutil.cpp
+++ b/src/wallet/walletutil.cpp
@@ -71,11 +71,11 @@ std::vector<fs::path> ListWalletDir()
// This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60.
const fs::path path = it->path().string().substr(offset);
- if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet.dat")) {
+ if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet_dat")) {
// Found a directory which contains wallet.dat btree file, add it as a wallet.
paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && IsBerkeleyBtree(it->path())) {
- if (it->path().filename() == "wallet.dat") {
+ if (it->path().filename() == "wallet_dat") {
// Found top-level wallet.dat btree file, add top level directory ""
// as a wallet.
paths.emplace_back();
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 100be26c59..fa72420178 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -103,7 +103,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.supports_cli = True
self.bind_to_localhost_only = True
self.default_wallet_name = ""
- self.wallet_data_filename = "wallet.dat"
+ self.wallet_data_filename = "wallet_dat"
self.set_test_params()
self.parse_args()
if self.options.timeout_factor == 0 :
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py
index ef68e224b6..8d3e7f8f62 100755
--- a/test/functional/tool_wallet.py
+++ b/test/functional/tool_wallet.py
@@ -73,7 +73,7 @@ class ToolWalletTest(BitcoinTestFramework):
locked_dir = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets")
self.assert_raises_tool_error(
'Error initializing wallet database environment "{}"!'.format(locked_dir),
- '-wallet=wallet.dat',
+ '-wallet=wallet_dat',
'info',
)
path = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets", "nonexistent.dat")
@@ -104,7 +104,7 @@ class ToolWalletTest(BitcoinTestFramework):
Transactions: 0
Address Book: 3
''')
- self.assert_tool_output(out, '-wallet=wallet.dat', 'info')
+ self.assert_tool_output(out, '-wallet=wallet_dat', 'info')
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
self.log_wallet_timestamp_comparison(timestamp_before, timestamp_after)
@@ -143,7 +143,7 @@ class ToolWalletTest(BitcoinTestFramework):
Transactions: 1
Address Book: 3
''')
- self.assert_tool_output(out, '-wallet=wallet.dat', 'info')
+ self.assert_tool_output(out, '-wallet=wallet_dat', 'info')
shasum_after = self.wallet_shasum()
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py
index 09581d864b..5fdabf89c8 100755
--- a/test/functional/wallet_dump.py
+++ b/test/functional/wallet_dump.py
@@ -203,7 +203,7 @@ class WalletDumpTest(BitcoinTestFramework):
assert result['ismine']
self.log.info('Check that wallet is flushed')
- with self.nodes[0].assert_debug_log(['Flushing wallet.dat'], timeout=20):
+ with self.nodes[0].assert_debug_log(['Flushing wallet_dat'], timeout=20):
self.nodes[0].getnewaddress()
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py
index 7b975af065..71aa86abdb 100755
--- a/test/functional/wallet_multiwallet.py
+++ b/test/functional/wallet_multiwallet.py
@@ -95,7 +95,7 @@ class MultiWalletTest(BitcoinTestFramework):
# w8 - to verify existing wallet file is loaded correctly
# '' - to verify default wallet file is created correctly
wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name]
- extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names]
+ extra_args = ['-wallet={}'.format(n) for n in wallet_names]
self.start_node(0, extra_args)
assert_equal(sorted(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), [self.default_wallet_name, os.path.join('sub', 'w5'), 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'])
@@ -108,7 +108,7 @@ class MultiWalletTest(BitcoinTestFramework):
# should not initialize if wallet path can't be created
exp_stderr = "boost::filesystem::create_directory:"
- self.nodes[0].assert_start_raises_init_error(['-wallet=wallet.dat/bad'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
+ self.nodes[0].assert_start_raises_init_error(['-wallet={}/bad'.format(self.wallet_data_filename)], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" does not exist')
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" is a relative path', cwd=data_dir())