aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <gmaxwell@gmail.com>2012-05-08 12:37:27 -0700
committerGregory Maxwell <gmaxwell@gmail.com>2012-05-08 12:37:27 -0700
commitf1ae31d8af8e03acbd224d486542b4409acf01ff (patch)
treec8869fb430c7b33b235e870e1066c9edd47fc3d5 /src/init.cpp
parentfa8cc47c4f70bd3e2b0f4bc5076aba40597b12ec (diff)
parent1d740055daa6e1668f047186d208b0693c6b21ba (diff)
Merge pull request #883 from sipa/loadblock
Add -loadblock to load from an external blk000?.dat file
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3fe6d1b091..b89c9edf89 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -226,7 +226,8 @@ bool AppInit2(int argc, char* argv[])
" -keypool=<n> \t " + _("Set key pool size to <n> (default: 100)") + "\n" +
" -rescan \t " + _("Rescan the block chain for missing wallet transactions") + "\n" +
" -checkblocks=<n> \t\t " + _("How many blocks to check at startup (default: 2500, 0 = all)") + "\n" +
- " -checklevel=<n> \t\t " + _("How thorough the block verification is (0-6, default: 1)") + "\n";
+ " -checklevel=<n> \t\t " + _("How thorough the block verification is (0-6, default: 1)") + "\n" +
+ " -loadblock=<file>\t " + _("Imports blocks from external blk000?.dat file") + "\n";
strUsage += string() +
_("\nSSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n" +
@@ -367,6 +368,16 @@ bool AppInit2(int argc, char* argv[])
}
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ if (mapArgs.count("-loadblock"))
+ {
+ BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"])
+ {
+ FILE *file = fopen(strFile.c_str(), "rb");
+ if (file)
+ LoadExternalBlockFile(file);
+ }
+ }
+
InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();