diff options
| author | Jeff Garzik <[email protected]> | 2012-10-20 13:36:36 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2012-10-20 13:36:36 -0700 |
| commit | 38ac953b9df1f7a884c1ef0e94301e14c4e7477d (patch) | |
| tree | 03ba74b23e9ccf077fc234e02af068cf40397fd1 /src/init.cpp | |
| parent | Merge pull request #1742 from sipa/canonical (diff) | |
| parent | Move external block import to separate thread (diff) | |
| download | discoin-38ac953b9df1f7a884c1ef0e94301e14c4e7477d.tar.xz discoin-38ac953b9df1f7a884c1ef0e94301e14c4e7477d.zip | |
Merge pull request #1880 from sipa/threadimport
Move external block import to separate thread
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8a928218b..92c752a8f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -776,29 +776,13 @@ bool AppInit2() // ********************************************************* Step 9: import blocks + std::vector<boost::filesystem::path> *vPath = new std::vector<boost::filesystem::path>(); if (mapArgs.count("-loadblock")) { - uiInterface.InitMessage(_("Importing blockchain data file.")); - BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"]) - { - FILE *file = fopen(strFile.c_str(), "rb"); - if (file) - LoadExternalBlockFile(file); - } - } - - filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; - if (filesystem::exists(pathBootstrap)) { - uiInterface.InitMessage(_("Importing bootstrap blockchain data file.")); - - FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); - if (file) { - filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; - LoadExternalBlockFile(file); - RenameOver(pathBootstrap, pathBootstrapOld); - } + vPath->push_back(strFile); } + NewThread(ThreadImport, vPath); // ********************************************************* Step 10: load peers |