mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Remove -printblock, -printblocktree, and -printblockindex
This commit is contained in:
30
src/init.cpp
30
src/init.cpp
@@ -330,8 +330,6 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n";
|
||||
if (GetBoolArg("-help-debug", false))
|
||||
{
|
||||
strUsage += " -printblock=<hash> " + _("Print block on startup, if found in block index") + "\n";
|
||||
strUsage += " -printblocktree " + strprintf(_("Print block tree on startup (default: %u)"), 0) + "\n";
|
||||
strUsage += " -printpriority " + strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"), 0) + "\n";
|
||||
strUsage += " -privdb " + strprintf(_("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"), 1) + "\n";
|
||||
strUsage += " -regtest " + _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.") + "\n";
|
||||
@@ -1048,34 +1046,6 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
}
|
||||
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
|
||||
|
||||
if (GetBoolArg("-printblockindex", false) || GetBoolArg("-printblocktree", false))
|
||||
{
|
||||
PrintBlockTree();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mapArgs.count("-printblock"))
|
||||
{
|
||||
string strMatch = mapArgs["-printblock"];
|
||||
int nFound = 0;
|
||||
for (BlockMap::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
|
||||
{
|
||||
uint256 hash = (*mi).first;
|
||||
if (boost::algorithm::starts_with(hash.ToString(), strMatch))
|
||||
{
|
||||
CBlockIndex* pindex = (*mi).second;
|
||||
CBlock block;
|
||||
ReadBlockFromDisk(block, pindex);
|
||||
block.BuildMerkleTree();
|
||||
LogPrintf("%s\n", block.ToString());
|
||||
nFound++;
|
||||
}
|
||||
}
|
||||
if (nFound == 0)
|
||||
LogPrintf("No blocks matching %s were found\n", strMatch);
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
|
||||
CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION);
|
||||
// Allowed to fail as this file IS missing on first startup.
|
||||
|
||||
Reference in New Issue
Block a user