From 66b02c93e69cfeaec6e7fa19a03bfb2649025a56 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 13 Sep 2012 14:33:52 +0200 Subject: Move external block import to separate thread --- src/init.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/init.cpp') 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 *vPath = new std::vector(); 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 -- cgit v1.2.3