diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-12-28 21:11:55 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-12-28 23:03:46 +0000 |
| commit | 09533557b59a19fc450f7a38997928cd6895b305 (patch) | |
| tree | ac4d411e214155dc98a55fd700e3270a34ee67f7 /src/cryptonote_core/cryptonote_core.cpp | |
| parent | 95ceb715dc875823f56f930d12a08c349874ce19 (diff) | |
| download | monzero-core-09533557b59a19fc450f7a38997928cd6895b305.tar.gz monzero-core-09533557b59a19fc450f7a38997928cd6895b305.tar.xz monzero-core-09533557b59a19fc450f7a38997928cd6895b305.zip | |
blockchain_db: inform user about new format if blockchain.bin is found
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 8a3b81205..2f6980aec 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -266,6 +266,28 @@ namespace cryptonote LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ..."); + // check for blockchain.bin + bool old_blockchain_found = false; + try + { + const boost::filesystem::path old_files = folder.parent_path(); + if (boost::filesystem::exists(folder.parent_path() / "blockchain.bin")) + { + LOG_PRINT_L0("Found old-style blockchain.bin in " << old_files.string()); + LOG_PRINT_L0("Monero now uses a new format. You can either remove blockchain.bin to start syncing"); + LOG_PRINT_L0("the blockchain anew, or use blockchain_export and blockchain_import to convert your"); + LOG_PRINT_L0("existing blockchain.bin to the new format. See README.md for instructions."); + old_blockchain_found = true; + } + } + // folder might not be a directory, etc, etc + catch (...) {} + + if (old_blockchain_found) + { + throw DB_ERROR("Database could not be opened"); + } + const std::string filename = folder.string(); // temporarily default to fastest:async:1000 blockchain_db_sync_mode sync_mode = db_async; |
