diff options
| author | Riccardo Spagni <ric@spagni.net> | 2015-10-20 20:55:39 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2015-10-20 20:55:53 +0200 |
| commit | 14dd279fe123d7b48baed82d9109c585839b678f (patch) | |
| tree | a79e281f205a0578312aa3b7cfc9a488036b9078 /src/blockchain_utilities/bootstrap_file.cpp | |
| parent | e6d2460263e091fd0b82f5babfdac21326cc85c4 (diff) | |
| parent | b13e7f284b909df8ca54fe93c231910a130f9f3e (diff) | |
| download | monzero-core-14dd279fe123d7b48baed82d9109c585839b678f.tar.gz monzero-core-14dd279fe123d7b48baed82d9109c585839b678f.tar.xz monzero-core-14dd279fe123d7b48baed82d9109c585839b678f.zip | |
Merge pull request #437
b13e7f2 blockchain_export can now export to a blocks.dat format (moneromooo-monero)
11db442 bootstrap_file: do not try to create a directory with an empty name (moneromooo-monero)
03bc610 hardfork: use DB transactions when reorganizing (moneromooo-monero)
439c455 hardfork: simplify work done on reload (moneromooo-monero)
Diffstat (limited to 'src/blockchain_utilities/bootstrap_file.cpp')
| -rw-r--r-- | src/blockchain_utilities/bootstrap_file.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/blockchain_utilities/bootstrap_file.cpp b/src/blockchain_utilities/bootstrap_file.cpp index ab841c8c6..d66d2f604 100644 --- a/src/blockchain_utilities/bootstrap_file.cpp +++ b/src/blockchain_utilities/bootstrap_file.cpp @@ -53,20 +53,23 @@ namespace bool BootstrapFile::open_writer(const boost::filesystem::path& file_path) { const boost::filesystem::path dir_path = file_path.parent_path(); - if (boost::filesystem::exists(dir_path)) + if (!dir_path.empty()) { - if (!boost::filesystem::is_directory(dir_path)) + if (boost::filesystem::exists(dir_path)) { - LOG_PRINT_RED_L0("export directory path is a file: " << dir_path); - return false; + if (!boost::filesystem::is_directory(dir_path)) + { + LOG_PRINT_RED_L0("export directory path is a file: " << dir_path); + return false; + } } - } - else - { - if (!boost::filesystem::create_directory(dir_path)) + else { - LOG_PRINT_RED_L0("Failed to create directory " << dir_path); - return false; + if (!boost::filesystem::create_directory(dir_path)) + { + LOG_PRINT_RED_L0("Failed to create directory " << dir_path); + return false; + } } } |
