Skip to content
Permalink
Browse files

wallet: Ignore recursive_directory_iterator errors in ListWalletDir

  • Loading branch information...
promag committed Mar 11, 2019
1 parent 257f750 commit 8de53d5097c7e0936a15ec738e2580814ee0de9b
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/wallet/walletutil.cpp
@@ -54,8 +54,9 @@ std::vector<fs::path> ListWalletDir()
const fs::path wallet_dir = GetWalletDir();
const size_t offset = wallet_dir.string().size() + 1;
std::vector<fs::path> paths;
boost::system::error_code ec;

for (auto it = fs::recursive_directory_iterator(wallet_dir); it != fs::recursive_directory_iterator(); ++it) {
for (auto it = fs::recursive_directory_iterator(wallet_dir, ec); it != fs::recursive_directory_iterator(); it.increment(ec)) {
// Get wallet path relative to walletdir by removing walletdir from the wallet path.
// 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);

0 comments on commit 8de53d5

Please sign in to comment.
You can’t perform that action at this time.