diff --git a/doc/developer-notes.md b/doc/developer-notes.md --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -471,7 +471,7 @@ - ThreadScriptCheck : Verifies block scripts. -- ThreadImport : Loads blocks from blk*.dat files or bootstrap.dat. +- ThreadImport : Loads blocks from `blk*.dat` files or `-loadblock=`. - StartNode : Starts other threads. diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -34,6 +34,9 @@ information. This option is experimental and subject to changes or removal in future releases. +- Importing blocks upon startup via the `bootstrap.dat` file no longer occurs + by default. The file must now be specified with `-loadblock=`. + Build system changes -------------------- diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -474,7 +474,7 @@ DEFAULT_MAX_REORG_DEPTH), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); gArgs.AddArg("-loadblock=", - "Imports blocks from external blk000??.dat file on startup", + "Imports blocks from external file on startup", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); gArgs.AddArg("-maxmempool=", strprintf("Keep the transaction memory pool below " @@ -1331,21 +1331,6 @@ LoadGenesisBlock(chainParams); } - // hardcoded $DATADIR/bootstrap.dat - fs::path pathBootstrap = GetDataDir() / "bootstrap.dat"; - if (fs::exists(pathBootstrap)) { - FILE *file = fsbridge::fopen(pathBootstrap, "rb"); - if (file) { - fs::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; - LogPrintf("Importing bootstrap.dat...\n"); - LoadExternalBlockFile(config, file); - RenameOver(pathBootstrap, pathBootstrapOld); - } else { - LogPrintf("Warning: Could not open bootstrap file %s\n", - pathBootstrap.string()); - } - } - // -loadblock= for (const fs::path &path : vImportFiles) { FILE *file = fsbridge::fopen(path, "rb");