Skip to content

Commit 104f7de

Browse files
tryphefjahr
authored andcommitted
remove old bootstrap relevant code
- only load blockfiles when we have paths - add release notes for modified bootstrap functionality - amend documentation on ThreadImport
1 parent a689c11 commit 104f7de

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

doc/developer-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Threads
385385

386386
- ThreadScriptCheck : Verifies block scripts.
387387

388-
- ThreadImport : Loads blocks from blk*.dat files or bootstrap.dat.
388+
- ThreadImport : Loads blocks from `blk*.dat` files or `-loadblock=<file>`.
389389

390390
- StartNode : Starts other threads.
391391

doc/release-notes-15954.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Configuration option changes
2+
-----------------------------
3+
4+
Importing blocks upon startup via the `bootstrap.dat` file no longer occurs by default. The file must now be specified with `-loadblock=<file>`.

src/init.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ void SetupServerArgs()
374374
gArgs.AddArg("-debuglogfile=<file>", strprintf("Specify location of debug log file. Relative paths will be prefixed by a net-specific datadir location. (-nodebuglogfile to disable; default: %s)", DEFAULT_DEBUGLOGFILE), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
375375
gArgs.AddArg("-feefilter", strprintf("Tell other nodes to filter invs to us by our mempool min fee (default: %u)", DEFAULT_FEEFILTER), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
376376
gArgs.AddArg("-includeconf=<file>", "Specify additional configuration file, relative to the -datadir path (only useable from configuration file, not command line)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
377-
gArgs.AddArg("-loadblock=<file>", "Imports blocks from external blk000??.dat file on startup", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
377+
gArgs.AddArg("-loadblock=<file>", "Imports blocks from external file on startup", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
378378
gArgs.AddArg("-maxmempool=<n>", strprintf("Keep the transaction memory pool below <n> megabytes (default: %u)", DEFAULT_MAX_MEMPOOL_SIZE), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
379379
gArgs.AddArg("-maxorphantx=<n>", strprintf("Keep at most <n> unconnectable transactions in memory (default: %u)", DEFAULT_MAX_ORPHAN_TRANSACTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
380380
gArgs.AddArg("-mempoolexpiry=<n>", strprintf("Do not keep transactions in the mempool longer than <n> hours (default: %u)", DEFAULT_MEMPOOL_EXPIRY), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
@@ -687,20 +687,6 @@ static void ThreadImport(std::vector<fs::path> vImportFiles)
687687
LoadGenesisBlock(chainparams);
688688
}
689689

690-
// hardcoded $DATADIR/bootstrap.dat
691-
fs::path pathBootstrap = GetDataDir() / "bootstrap.dat";
692-
if (fs::exists(pathBootstrap)) {
693-
FILE *file = fsbridge::fopen(pathBootstrap, "rb");
694-
if (file) {
695-
fs::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old";
696-
LogPrintf("Importing bootstrap.dat...\n");
697-
LoadExternalBlockFile(chainparams, file);
698-
RenameOver(pathBootstrap, pathBootstrapOld);
699-
} else {
700-
LogPrintf("Warning: Could not open bootstrap file %s\n", pathBootstrap.string());
701-
}
702-
}
703-
704690
// -loadblock=
705691
for (const fs::path& path : vImportFiles) {
706692
FILE *file = fsbridge::fopen(path, "rb");

0 commit comments

Comments
 (0)