mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 06:23:13 +02:00
log: Use warning level while scanning wallet dir
This commit is contained in:
@@ -56,7 +56,7 @@ std::vector<std::pair<fs::path, std::string>> ListDatabases(const fs::path& wall
|
||||
}
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
LogPrintf("%s: Error scanning %s: %s\n", __func__, fs::PathToString(it->path()), e.what());
|
||||
LogWarning("Error while scanning wallet dir item: %s [%s].", e.what(), fs::PathToString(it->path()));
|
||||
it.disable_recursion_pending();
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ bool IsBDBFile(const fs::path& path)
|
||||
// This check also prevents opening lock files.
|
||||
std::error_code ec;
|
||||
auto size = fs::file_size(path, ec);
|
||||
if (ec) LogPrintf("%s: %s %s\n", __func__, ec.message(), fs::PathToString(path));
|
||||
if (ec) LogWarning("Error reading file_size: %s [%s]", ec.message(), fs::PathToString(path));
|
||||
if (size < 4096) return false;
|
||||
|
||||
std::ifstream file{path, std::ios::binary};
|
||||
@@ -123,7 +123,7 @@ bool IsSQLiteFile(const fs::path& path)
|
||||
// A SQLite Database file is at least 512 bytes.
|
||||
std::error_code ec;
|
||||
auto size = fs::file_size(path, ec);
|
||||
if (ec) LogPrintf("%s: %s %s\n", __func__, ec.message(), fs::PathToString(path));
|
||||
if (ec) LogWarning("Error reading file_size: %s [%s]", ec.message(), fs::PathToString(path));
|
||||
if (size < 512) return false;
|
||||
|
||||
std::ifstream file{path, std::ios::binary};
|
||||
|
@@ -147,7 +147,7 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||
os.mkdir(wallet_dir('no_access'))
|
||||
os.chmod(wallet_dir('no_access'), 0)
|
||||
try:
|
||||
with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']):
|
||||
with self.nodes[0].assert_debug_log(expected_msgs=["Error while scanning wallet dir"]):
|
||||
walletlist = self.nodes[0].listwalletdir()['wallets']
|
||||
finally:
|
||||
# Need to ensure access is restored for cleanup
|
||||
|
Reference in New Issue
Block a user