Merge bitcoin/bitcoin#32967: log: [refactor] Use info level for init logs
face8123fdlog: [refactor] Use info level for init logs (MarcoFalke)fa183761cblog: Remove function name from init logs (MarcoFalke) Pull request description: Many of the normal, and expected init logs, which are run once after startup use the deprecated alias of `LogInfo`. Fix that by using `LogInfo` directly, which is a refactor, except for a few log lines that also have `__func__` removed. (Also remove the unused trailing `\n` char while touching those logs) ACKs for top commit: stickies-v: re-ACKface8123fdfanquake: ACKface8123fdTree-SHA512: 28c296129c9a31dff04f529c53db75057eae8a73fc7419e2f3068963dbb7b7fb9a457b2653f9120361fdb06ac97d1ee2be815c09ac659780dff01d7cd29f8480
This commit is contained in:
28 files changed
+120
-115
No files matched your search
+1
-1
@@ -39,7 +39,7 @@ void BanMan::LoadBanlist()
|
|||||||
LogDebug(BCLog::NET, "Loaded %d banned node addresses/subnets %dms\n", m_banned.size(),
|
LogDebug(BCLog::NET, "Loaded %d banned node addresses/subnets %dms\n", m_banned.size(),
|
||||||
Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("Recreating the banlist database\n");
|
LogInfo("Recreating the banlist database");
|
||||||
m_banned = {};
|
m_banned = {};
|
||||||
m_is_dirty = true;
|
m_is_dirty = true;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -96,7 +96,8 @@ void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& opti
|
|||||||
if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
|
if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
|
||||||
options.version_bits_parameters[Consensus::DeploymentPos(j)] = vbparams;
|
options.version_bits_parameters[Consensus::DeploymentPos(j)] = vbparams;
|
||||||
found = true;
|
found = true;
|
||||||
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, min_activation_height=%d\n", vDeploymentParams[0], vbparams.start_time, vbparams.timeout, vbparams.min_activation_height);
|
LogInfo("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, min_activation_height=%d",
|
||||||
|
vDeploymentParams[0], vbparams.start_time, vbparams.timeout, vbparams.min_activation_height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -228,12 +228,12 @@ CDBWrapper::CDBWrapper(const DBParams& params)
|
|||||||
DBContext().options.env = DBContext().penv;
|
DBContext().options.env = DBContext().penv;
|
||||||
} else {
|
} else {
|
||||||
if (params.wipe_data) {
|
if (params.wipe_data) {
|
||||||
LogPrintf("Wiping LevelDB in %s\n", fs::PathToString(params.path));
|
LogInfo("Wiping LevelDB in %s", fs::PathToString(params.path));
|
||||||
leveldb::Status result = leveldb::DestroyDB(fs::PathToString(params.path), DBContext().options);
|
leveldb::Status result = leveldb::DestroyDB(fs::PathToString(params.path), DBContext().options);
|
||||||
HandleError(result);
|
HandleError(result);
|
||||||
}
|
}
|
||||||
TryCreateDirectories(params.path);
|
TryCreateDirectories(params.path);
|
||||||
LogPrintf("Opening LevelDB in %s\n", fs::PathToString(params.path));
|
LogInfo("Opening LevelDB in %s", fs::PathToString(params.path));
|
||||||
}
|
}
|
||||||
// PathToString() return value is safe to pass to leveldb open function,
|
// PathToString() return value is safe to pass to leveldb open function,
|
||||||
// because on POSIX leveldb passes the byte string directly to ::open(), and
|
// because on POSIX leveldb passes the byte string directly to ::open(), and
|
||||||
@@ -241,12 +241,12 @@ CDBWrapper::CDBWrapper(const DBParams& params)
|
|||||||
// (see env_posix.cc and env_windows.cc).
|
// (see env_posix.cc and env_windows.cc).
|
||||||
leveldb::Status status = leveldb::DB::Open(DBContext().options, fs::PathToString(params.path), &DBContext().pdb);
|
leveldb::Status status = leveldb::DB::Open(DBContext().options, fs::PathToString(params.path), &DBContext().pdb);
|
||||||
HandleError(status);
|
HandleError(status);
|
||||||
LogPrintf("Opened LevelDB successfully\n");
|
LogInfo("Opened LevelDB successfully");
|
||||||
|
|
||||||
if (params.options.force_compact) {
|
if (params.options.force_compact) {
|
||||||
LogPrintf("Starting database compaction of %s\n", fs::PathToString(params.path));
|
LogInfo("Starting database compaction of %s", fs::PathToString(params.path));
|
||||||
DBContext().pdb->CompactRange(nullptr, nullptr);
|
DBContext().pdb->CompactRange(nullptr, nullptr);
|
||||||
LogPrintf("Finished database compaction of %s\n", fs::PathToString(params.path));
|
LogInfo("Finished database compaction of %s", fs::PathToString(params.path));
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!m_obfuscation); // Needed for unobfuscated Read()/Write() below
|
assert(!m_obfuscation); // Needed for unobfuscated Read()/Write() below
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ public:
|
|||||||
bool HasWalletSupport() const override {return false;}
|
bool HasWalletSupport() const override {return false;}
|
||||||
void AddWalletOptions(ArgsManager& argsman) const override;
|
void AddWalletOptions(ArgsManager& argsman) const override;
|
||||||
bool ParameterInteraction() const override {return true;}
|
bool ParameterInteraction() const override {return true;}
|
||||||
void Construct(node::NodeContext& node) const override {LogPrintf("No wallet support compiled in!\n");}
|
void Construct(node::NodeContext& node) const override { LogInfo("No wallet support compiled in!"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
void DummyWalletInit::AddWalletOptions(ArgsManager& argsman) const
|
void DummyWalletInit::AddWalletOptions(ArgsManager& argsman) const
|
||||||
|
|||||||
+1
-1
@@ -391,7 +391,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
|||||||
|
|
||||||
// Bind addresses
|
// Bind addresses
|
||||||
for (std::vector<std::pair<std::string, uint16_t> >::iterator i = endpoints.begin(); i != endpoints.end(); ++i) {
|
for (std::vector<std::pair<std::string, uint16_t> >::iterator i = endpoints.begin(); i != endpoints.end(); ++i) {
|
||||||
LogPrintf("Binding RPC on address %s port %i\n", i->first, i->second);
|
LogInfo("Binding RPC on address %s port %i", i->first, i->second);
|
||||||
evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second);
|
evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second);
|
||||||
if (bind_handle) {
|
if (bind_handle) {
|
||||||
const std::optional<CNetAddr> addr{LookupHost(i->first, false)};
|
const std::optional<CNetAddr> addr{LookupHost(i->first, false)};
|
||||||
|
|||||||
+20
-18
@@ -284,7 +284,7 @@ void Shutdown(NodeContext& node)
|
|||||||
static Mutex g_shutdown_mutex;
|
static Mutex g_shutdown_mutex;
|
||||||
TRY_LOCK(g_shutdown_mutex, lock_shutdown);
|
TRY_LOCK(g_shutdown_mutex, lock_shutdown);
|
||||||
if (!lock_shutdown) return;
|
if (!lock_shutdown) return;
|
||||||
LogPrintf("%s: In progress...\n", __func__);
|
LogInfo("Shutdown in progress...");
|
||||||
Assert(node.args);
|
Assert(node.args);
|
||||||
|
|
||||||
/// Note: Shutdown() must be able to handle cases in which initialization failed part of the way,
|
/// Note: Shutdown() must be able to handle cases in which initialization failed part of the way,
|
||||||
@@ -395,7 +395,7 @@ void Shutdown(NodeContext& node)
|
|||||||
|
|
||||||
RemovePidFile(*node.args);
|
RemovePidFile(*node.args);
|
||||||
|
|
||||||
LogPrintf("%s: done\n", __func__);
|
LogInfo("Shutdown done");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -898,7 +898,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
|||||||
// on the command line or in this chain's section of the config file.
|
// on the command line or in this chain's section of the config file.
|
||||||
ChainType chain = args.GetChainType();
|
ChainType chain = args.GetChainType();
|
||||||
if (chain == ChainType::SIGNET) {
|
if (chain == ChainType::SIGNET) {
|
||||||
LogPrintf("Signet derived magic (message start): %s\n", HexStr(chainparams.MessageStart()));
|
LogInfo("Signet derived magic (message start): %s", HexStr(chainparams.MessageStart()));
|
||||||
}
|
}
|
||||||
bilingual_str errors;
|
bilingual_str errors;
|
||||||
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
|
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
|
||||||
@@ -1234,7 +1234,9 @@ static ChainstateLoadResult InitAndLoadChainstate(
|
|||||||
if (!mempool_error.empty()) {
|
if (!mempool_error.empty()) {
|
||||||
return {ChainstateLoadStatus::FAILURE_FATAL, mempool_error};
|
return {ChainstateLoadStatus::FAILURE_FATAL, mempool_error};
|
||||||
}
|
}
|
||||||
LogPrintf("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)\n", cache_sizes.coins * (1.0 / 1024 / 1024), mempool_opts.max_size_bytes * (1.0 / 1024 / 1024));
|
LogInfo("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)",
|
||||||
|
cache_sizes.coins * (1.0 / 1024 / 1024),
|
||||||
|
mempool_opts.max_size_bytes * (1.0 / 1024 / 1024));
|
||||||
ChainstateManager::Options chainman_opts{
|
ChainstateManager::Options chainman_opts{
|
||||||
.chainparams = chainparams,
|
.chainparams = chainparams,
|
||||||
.datadir = args.GetDataDirNet(),
|
.datadir = args.GetDataDirNet(),
|
||||||
@@ -1274,10 +1276,10 @@ static ChainstateLoadResult InitAndLoadChainstate(
|
|||||||
// libbitcoinkernel.
|
// libbitcoinkernel.
|
||||||
chainman.snapshot_download_completed = [&node]() {
|
chainman.snapshot_download_completed = [&node]() {
|
||||||
if (!node.chainman->m_blockman.IsPruneMode()) {
|
if (!node.chainman->m_blockman.IsPruneMode()) {
|
||||||
LogPrintf("[snapshot] re-enabling NODE_NETWORK services\n");
|
LogInfo("[snapshot] re-enabling NODE_NETWORK services");
|
||||||
node.connman->AddLocalServices(NODE_NETWORK);
|
node.connman->AddLocalServices(NODE_NETWORK);
|
||||||
}
|
}
|
||||||
LogPrintf("[snapshot] restarting indexes\n");
|
LogInfo("[snapshot] restarting indexes");
|
||||||
// Drain the validation interface queue to ensure that the old indexes
|
// Drain the validation interface queue to ensure that the old indexes
|
||||||
// don't have any pending work.
|
// don't have any pending work.
|
||||||
Assert(node.validation_signals)->SyncWithValidationInterfaceQueue();
|
Assert(node.validation_signals)->SyncWithValidationInterfaceQueue();
|
||||||
@@ -1345,7 +1347,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("Using at most %i automatic connections (%i file descriptors available)\n", nMaxConnections, available_fds);
|
LogInfo("Using at most %i automatic connections (%i file descriptors available)", nMaxConnections, available_fds);
|
||||||
|
|
||||||
// Warn about relative -datadir path.
|
// Warn about relative -datadir path.
|
||||||
if (args.IsArgSet("-datadir") && !args.GetPathArg("-datadir").is_absolute()) {
|
if (args.IsArgSet("-datadir") && !args.GetPathArg("-datadir").is_absolute()) {
|
||||||
@@ -1402,7 +1404,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
return InitError(Untranslated(strprintf("Unable to bind to IPC address '%s'. %s", address, e.what())));
|
return InitError(Untranslated(strprintf("Unable to bind to IPC address '%s'. %s", address, e.what())));
|
||||||
}
|
}
|
||||||
LogPrintf("Listening for IPC requests on address %s\n", address);
|
LogInfo("Listening for IPC requests on address %s", address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1495,9 +1497,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const uint256 asmap_version = (HashWriter{} << asmap).GetHash();
|
const uint256 asmap_version = (HashWriter{} << asmap).GetHash();
|
||||||
LogPrintf("Using asmap version %s for IP bucketing\n", asmap_version.ToString());
|
LogInfo("Using asmap version %s for IP bucketing", asmap_version.ToString());
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("Using /16 prefix for IP bucketing\n");
|
LogInfo("Using /16 prefix for IP bucketing");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize netgroup manager
|
// Initialize netgroup manager
|
||||||
@@ -1753,7 +1755,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
// As LoadBlockIndex can take several minutes, it's possible the user
|
// As LoadBlockIndex can take several minutes, it's possible the user
|
||||||
// requested to kill the GUI during the last operation. If so, exit.
|
// requested to kill the GUI during the last operation. If so, exit.
|
||||||
if (ShutdownRequested(node)) {
|
if (ShutdownRequested(node)) {
|
||||||
LogPrintf("Shutdown requested. Exiting.\n");
|
LogInfo("Shutdown requested. Exiting.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1808,10 +1810,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
} else {
|
} else {
|
||||||
// Prior to setting NODE_NETWORK, check if we can provide historical blocks.
|
// Prior to setting NODE_NETWORK, check if we can provide historical blocks.
|
||||||
if (!WITH_LOCK(chainman.GetMutex(), return chainman.BackgroundSyncInProgress())) {
|
if (!WITH_LOCK(chainman.GetMutex(), return chainman.BackgroundSyncInProgress())) {
|
||||||
LogPrintf("Setting NODE_NETWORK on non-prune mode\n");
|
LogInfo("Setting NODE_NETWORK on non-prune mode");
|
||||||
g_local_services = ServiceFlags(g_local_services | NODE_NETWORK);
|
g_local_services = ServiceFlags(g_local_services | NODE_NETWORK);
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("Running node in NODE_NETWORK_LIMITED mode until snapshot background sync completes\n");
|
LogInfo("Running node in NODE_NETWORK_LIMITED mode until snapshot background sync completes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1870,7 +1872,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
// Import blocks and ActivateBestChain()
|
// Import blocks and ActivateBestChain()
|
||||||
ImportBlocks(chainman, vImportFiles);
|
ImportBlocks(chainman, vImportFiles);
|
||||||
if (args.GetBoolArg("-stopafterblockimport", DEFAULT_STOPAFTERBLOCKIMPORT)) {
|
if (args.GetBoolArg("-stopafterblockimport", DEFAULT_STOPAFTERBLOCKIMPORT)) {
|
||||||
LogPrintf("Stopping after block import\n");
|
LogInfo("Stopping after block import");
|
||||||
if (!(Assert(node.shutdown_request))()) {
|
if (!(Assert(node.shutdown_request))()) {
|
||||||
LogError("Failed to send shutdown signal after finishing block import\n");
|
LogError("Failed to send shutdown signal after finishing block import\n");
|
||||||
}
|
}
|
||||||
@@ -1918,7 +1920,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
{
|
{
|
||||||
LOCK(chainman.GetMutex());
|
LOCK(chainman.GetMutex());
|
||||||
const auto& tip{*Assert(chainman.ActiveTip())};
|
const auto& tip{*Assert(chainman.ActiveTip())};
|
||||||
LogPrintf("block tree size = %u\n", chainman.BlockIndex().size());
|
LogInfo("block tree size = %u", chainman.BlockIndex().size());
|
||||||
chain_active_height = tip.nHeight;
|
chain_active_height = tip.nHeight;
|
||||||
best_block_time = tip.GetBlockTime();
|
best_block_time = tip.GetBlockTime();
|
||||||
if (tip_info) {
|
if (tip_info) {
|
||||||
@@ -1931,7 +1933,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
tip_info->header_time = chainman.m_best_header->GetBlockTime();
|
tip_info->header_time = chainman.m_best_header->GetBlockTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogPrintf("nBestHeight = %d\n", chain_active_height);
|
LogInfo("nBestHeight = %d", chain_active_height);
|
||||||
if (node.peerman) node.peerman->SetBestBlock(chain_active_height, std::chrono::seconds{best_block_time});
|
if (node.peerman) node.peerman->SetBestBlock(chain_active_height, std::chrono::seconds{best_block_time});
|
||||||
|
|
||||||
// Map ports with NAT-PMP
|
// Map ports with NAT-PMP
|
||||||
@@ -2061,11 +2063,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
connOptions.m_specified_outgoing = connect;
|
connOptions.m_specified_outgoing = connect;
|
||||||
}
|
}
|
||||||
if (!connOptions.m_specified_outgoing.empty() && !connOptions.vSeedNodes.empty()) {
|
if (!connOptions.m_specified_outgoing.empty() && !connOptions.vSeedNodes.empty()) {
|
||||||
LogPrintf("-seednode is ignored when -connect is used\n");
|
LogInfo("-seednode is ignored when -connect is used");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.IsArgSet("-dnsseed") && args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED) && args.IsArgSet("-proxy")) {
|
if (args.IsArgSet("-dnsseed") && args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED) && args.IsArgSet("-proxy")) {
|
||||||
LogPrintf("-dnsseed is ignored when -connect is used and -proxy is specified\n");
|
LogInfo("-dnsseed is ignored when -connect is used and -proxy is specified");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-7
@@ -114,10 +114,11 @@ bool StartLogging(const ArgsManager& args)
|
|||||||
fs::PathToString(LogInstance().m_file_path))));
|
fs::PathToString(LogInstance().m_file_path))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LogInstance().m_log_timestamps)
|
if (!LogInstance().m_log_timestamps) {
|
||||||
LogPrintf("Startup time: %s\n", FormatISO8601DateTime(GetTime()));
|
LogInfo("Startup time: %s", FormatISO8601DateTime(GetTime()));
|
||||||
LogPrintf("Default data directory %s\n", fs::PathToString(GetDefaultDataDir()));
|
}
|
||||||
LogPrintf("Using data directory %s\n", fs::PathToString(gArgs.GetDataDirNet()));
|
LogInfo("Default data directory %s", fs::PathToString(GetDefaultDataDir()));
|
||||||
|
LogInfo("Using data directory %s", fs::PathToString(gArgs.GetDataDirNet()));
|
||||||
|
|
||||||
// Only log conf file usage message if conf file actually exists.
|
// Only log conf file usage message if conf file actually exists.
|
||||||
fs::path config_file_path = args.GetConfigFilePath();
|
fs::path config_file_path = args.GetConfigFilePath();
|
||||||
@@ -126,12 +127,12 @@ bool StartLogging(const ArgsManager& args)
|
|||||||
} else if (fs::is_directory(config_file_path)) {
|
} else if (fs::is_directory(config_file_path)) {
|
||||||
LogWarning("Config file: %s (is directory, not file)", fs::PathToString(config_file_path));
|
LogWarning("Config file: %s (is directory, not file)", fs::PathToString(config_file_path));
|
||||||
} else if (fs::exists(config_file_path)) {
|
} else if (fs::exists(config_file_path)) {
|
||||||
LogPrintf("Config file: %s\n", fs::PathToString(config_file_path));
|
LogInfo("Config file: %s", fs::PathToString(config_file_path));
|
||||||
} else if (args.IsArgSet("-conf")) {
|
} else if (args.IsArgSet("-conf")) {
|
||||||
InitWarning(strprintf(_("The specified config file %s does not exist"), fs::PathToString(config_file_path)));
|
InitWarning(strprintf(_("The specified config file %s does not exist"), fs::PathToString(config_file_path)));
|
||||||
} else {
|
} else {
|
||||||
// Not categorizing as "Warning" because it's the default behavior
|
// Not categorizing as "Warning" because it's the default behavior
|
||||||
LogPrintf("Config file: %s (not found, skipping)\n", fs::PathToString(config_file_path));
|
LogInfo("Config file: %s (not found, skipping)", fs::PathToString(config_file_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log the config arguments to debug.log
|
// Log the config arguments to debug.log
|
||||||
@@ -148,6 +149,6 @@ void LogPackageVersion()
|
|||||||
#else
|
#else
|
||||||
version_string += " (release build)";
|
version_string += " (release build)";
|
||||||
#endif
|
#endif
|
||||||
LogPrintf(CLIENT_NAME " version %s\n", version_string);
|
LogInfo(CLIENT_NAME " version %s", version_string);
|
||||||
}
|
}
|
||||||
} // namespace init
|
} // namespace init
|
||||||
@@ -423,7 +423,7 @@ public:
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
LogPrintf("Signet with challenge %s\n", HexStr(bin));
|
LogInfo("Signet with challenge %s", HexStr(bin));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.seeds) {
|
if (options.seeds) {
|
||||||
|
|||||||
+12
-12
@@ -298,7 +298,7 @@ void BlockManager::FindFilesToPruneManual(
|
|||||||
setFilesToPrune.insert(fileNumber);
|
setFilesToPrune.insert(fileNumber);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
LogPrintf("[%s] Prune (Manual): prune_height=%d removed %d blk/rev pairs\n",
|
LogInfo("[%s] Prune (Manual): prune_height=%d removed %d blk/rev pairs",
|
||||||
chain.GetRole(), last_block_can_prune, count);
|
chain.GetRole(), last_block_can_prune, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +418,7 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
|
|||||||
// to disk, we must bootstrap the value for assumedvalid chainstates
|
// to disk, we must bootstrap the value for assumedvalid chainstates
|
||||||
// from the hardcoded assumeutxo chainparams.
|
// from the hardcoded assumeutxo chainparams.
|
||||||
base->m_chain_tx_count = au_data.m_chain_tx_count;
|
base->m_chain_tx_count = au_data.m_chain_tx_count;
|
||||||
LogPrintf("[snapshot] set m_chain_tx_count=%d for %s\n", au_data.m_chain_tx_count, snapshot_blockhash->ToString());
|
LogInfo("[snapshot] set m_chain_tx_count=%d for %s", au_data.m_chain_tx_count, snapshot_blockhash->ToString());
|
||||||
} else {
|
} else {
|
||||||
// If this isn't called with a snapshot blockhash, make sure the cached snapshot height
|
// If this isn't called with a snapshot blockhash, make sure the cached snapshot height
|
||||||
// is null. This is relevant during snapshot completion, when the blockman may be loaded
|
// is null. This is relevant during snapshot completion, when the blockman may be loaded
|
||||||
@@ -508,11 +508,11 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
|
|||||||
// Load block file info
|
// Load block file info
|
||||||
m_block_tree_db->ReadLastBlockFile(max_blockfile_num);
|
m_block_tree_db->ReadLastBlockFile(max_blockfile_num);
|
||||||
m_blockfile_info.resize(max_blockfile_num + 1);
|
m_blockfile_info.resize(max_blockfile_num + 1);
|
||||||
LogPrintf("%s: last block file = %i\n", __func__, max_blockfile_num);
|
LogInfo("Loading block index db: last block file = %i", max_blockfile_num);
|
||||||
for (int nFile = 0; nFile <= max_blockfile_num; nFile++) {
|
for (int nFile = 0; nFile <= max_blockfile_num; nFile++) {
|
||||||
m_block_tree_db->ReadBlockFileInfo(nFile, m_blockfile_info[nFile]);
|
m_block_tree_db->ReadBlockFileInfo(nFile, m_blockfile_info[nFile]);
|
||||||
}
|
}
|
||||||
LogPrintf("%s: last block file info: %s\n", __func__, m_blockfile_info[max_blockfile_num].ToString());
|
LogInfo("Loading block index db: last block file info: %s", m_blockfile_info[max_blockfile_num].ToString());
|
||||||
for (int nFile = max_blockfile_num + 1; true; nFile++) {
|
for (int nFile = max_blockfile_num + 1; true; nFile++) {
|
||||||
CBlockFileInfo info;
|
CBlockFileInfo info;
|
||||||
if (m_block_tree_db->ReadBlockFileInfo(nFile, info)) {
|
if (m_block_tree_db->ReadBlockFileInfo(nFile, info)) {
|
||||||
@@ -523,7 +523,7 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check presence of blk files
|
// Check presence of blk files
|
||||||
LogPrintf("Checking all blk files are present...\n");
|
LogInfo("Checking all blk files are present...");
|
||||||
std::set<int> setBlkDataFiles;
|
std::set<int> setBlkDataFiles;
|
||||||
for (const auto& [_, block_index] : m_block_index) {
|
for (const auto& [_, block_index] : m_block_index) {
|
||||||
if (block_index.nStatus & BLOCK_HAVE_DATA) {
|
if (block_index.nStatus & BLOCK_HAVE_DATA) {
|
||||||
@@ -549,7 +549,7 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
|
|||||||
// Check whether we have ever pruned block & undo files
|
// Check whether we have ever pruned block & undo files
|
||||||
m_block_tree_db->ReadFlag("prunedblockfiles", m_have_pruned);
|
m_block_tree_db->ReadFlag("prunedblockfiles", m_have_pruned);
|
||||||
if (m_have_pruned) {
|
if (m_have_pruned) {
|
||||||
LogPrintf("LoadBlockIndexDB(): Block files have previously been pruned\n");
|
LogInfo("Loading block index db: Block files have previously been pruned");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether we need to continue reindexing
|
// Check whether we need to continue reindexing
|
||||||
@@ -622,7 +622,7 @@ void BlockManager::CleanupBlockRevFiles() const
|
|||||||
// Glob all blk?????.dat and rev?????.dat files from the blocks directory.
|
// Glob all blk?????.dat and rev?????.dat files from the blocks directory.
|
||||||
// Remove the rev files immediately and insert the blk file paths into an
|
// Remove the rev files immediately and insert the blk file paths into an
|
||||||
// ordered map keyed by block file index.
|
// ordered map keyed by block file index.
|
||||||
LogPrintf("Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune\n");
|
LogInfo("Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune");
|
||||||
for (fs::directory_iterator it(m_opts.blocks_dir); it != fs::directory_iterator(); it++) {
|
for (fs::directory_iterator it(m_opts.blocks_dir); it != fs::directory_iterator(); it++) {
|
||||||
const std::string path = fs::PathToString(it->path().filename());
|
const std::string path = fs::PathToString(it->path().filename());
|
||||||
if (fs::is_regular_file(*it) &&
|
if (fs::is_regular_file(*it) &&
|
||||||
@@ -1233,17 +1233,17 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
|
|||||||
if (file.IsNull()) {
|
if (file.IsNull()) {
|
||||||
break; // This error is logged in OpenBlockFile
|
break; // This error is logged in OpenBlockFile
|
||||||
}
|
}
|
||||||
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
|
LogInfo("Reindexing block file blk%05u.dat...", (unsigned int)nFile);
|
||||||
chainman.LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
|
chainman.LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
|
||||||
if (chainman.m_interrupt) {
|
if (chainman.m_interrupt) {
|
||||||
LogPrintf("Interrupt requested. Exit %s\n", __func__);
|
LogInfo("Interrupt requested. Exit reindexing.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nFile++;
|
nFile++;
|
||||||
}
|
}
|
||||||
WITH_LOCK(::cs_main, chainman.m_blockman.m_block_tree_db->WriteReindexing(false));
|
WITH_LOCK(::cs_main, chainman.m_blockman.m_block_tree_db->WriteReindexing(false));
|
||||||
chainman.m_blockman.m_blockfiles_indexed = true;
|
chainman.m_blockman.m_blockfiles_indexed = true;
|
||||||
LogPrintf("Reindexing finished\n");
|
LogInfo("Reindexing finished");
|
||||||
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
|
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
|
||||||
chainman.ActiveChainstate().LoadGenesisBlock();
|
chainman.ActiveChainstate().LoadGenesisBlock();
|
||||||
}
|
}
|
||||||
@@ -1252,10 +1252,10 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
|
|||||||
for (const fs::path& path : import_paths) {
|
for (const fs::path& path : import_paths) {
|
||||||
AutoFile file{fsbridge::fopen(path, "rb")};
|
AutoFile file{fsbridge::fopen(path, "rb")};
|
||||||
if (!file.IsNull()) {
|
if (!file.IsNull()) {
|
||||||
LogPrintf("Importing blocks file %s...\n", fs::PathToString(path));
|
LogInfo("Importing blocks file %s...", fs::PathToString(path));
|
||||||
chainman.LoadExternalBlockFile(file);
|
chainman.LoadExternalBlockFile(file);
|
||||||
if (chainman.m_interrupt) {
|
if (chainman.m_interrupt) {
|
||||||
LogPrintf("Interrupt requested. Exit %s\n", __func__);
|
LogInfo("Interrupt requested. Exit block importing.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ static ChainstateLoadResult CompleteChainstateInitialization(
|
|||||||
// block tree into BlockIndex()!
|
// block tree into BlockIndex()!
|
||||||
|
|
||||||
for (Chainstate* chainstate : chainman.GetAll()) {
|
for (Chainstate* chainstate : chainman.GetAll()) {
|
||||||
LogPrintf("Initializing chainstate %s\n", chainstate->ToString());
|
LogInfo("Initializing chainstate %s", chainstate->ToString());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
chainstate->InitCoinsDB(
|
chainstate->InitCoinsDB(
|
||||||
@@ -145,18 +145,19 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
|
|||||||
const ChainstateLoadOptions& options)
|
const ChainstateLoadOptions& options)
|
||||||
{
|
{
|
||||||
if (!chainman.AssumedValidBlock().IsNull()) {
|
if (!chainman.AssumedValidBlock().IsNull()) {
|
||||||
LogPrintf("Assuming ancestors of block %s have valid signatures.\n", chainman.AssumedValidBlock().GetHex());
|
LogInfo("Assuming ancestors of block %s have valid signatures.", chainman.AssumedValidBlock().GetHex());
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("Validating signatures for all blocks.\n");
|
LogInfo("Validating signatures for all blocks.");
|
||||||
}
|
}
|
||||||
LogPrintf("Setting nMinimumChainWork=%s\n", chainman.MinimumChainWork().GetHex());
|
LogInfo("Setting nMinimumChainWork=%s", chainman.MinimumChainWork().GetHex());
|
||||||
if (chainman.MinimumChainWork() < UintToArith256(chainman.GetConsensus().nMinimumChainWork)) {
|
if (chainman.MinimumChainWork() < UintToArith256(chainman.GetConsensus().nMinimumChainWork)) {
|
||||||
LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", chainman.GetConsensus().nMinimumChainWork.GetHex());
|
LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", chainman.GetConsensus().nMinimumChainWork.GetHex());
|
||||||
}
|
}
|
||||||
if (chainman.m_blockman.GetPruneTarget() == BlockManager::PRUNE_TARGET_MANUAL) {
|
if (chainman.m_blockman.GetPruneTarget() == BlockManager::PRUNE_TARGET_MANUAL) {
|
||||||
LogPrintf("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n");
|
LogInfo("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.");
|
||||||
} else if (chainman.m_blockman.GetPruneTarget()) {
|
} else if (chainman.m_blockman.GetPruneTarget()) {
|
||||||
LogPrintf("Prune configured to target %u MiB on disk for block and undo files.\n", chainman.m_blockman.GetPruneTarget() / 1024 / 1024);
|
LogInfo("Prune configured to target %u MiB on disk for block and undo files.",
|
||||||
|
chainman.m_blockman.GetPruneTarget() / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
@@ -171,7 +172,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
|
|||||||
bool has_snapshot = chainman.DetectSnapshotChainstate();
|
bool has_snapshot = chainman.DetectSnapshotChainstate();
|
||||||
|
|
||||||
if (has_snapshot && options.wipe_chainstate_db) {
|
if (has_snapshot && options.wipe_chainstate_db) {
|
||||||
LogPrintf("[snapshot] deleting snapshot chainstate due to reindexing\n");
|
LogInfo("[snapshot] deleting snapshot chainstate due to reindexing");
|
||||||
if (!chainman.DeleteSnapshotChainstate()) {
|
if (!chainman.DeleteSnapshotChainstate()) {
|
||||||
return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Couldn't remove snapshot chainstate.")};
|
return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Couldn't remove snapshot chainstate.")};
|
||||||
}
|
}
|
||||||
@@ -195,7 +196,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
|
|||||||
if (snapshot_completion == SnapshotCompletionResult::SKIPPED) {
|
if (snapshot_completion == SnapshotCompletionResult::SKIPPED) {
|
||||||
// do nothing; expected case
|
// do nothing; expected case
|
||||||
} else if (snapshot_completion == SnapshotCompletionResult::SUCCESS) {
|
} else if (snapshot_completion == SnapshotCompletionResult::SUCCESS) {
|
||||||
LogPrintf("[snapshot] cleaning up unneeded background chainstate, then reinitializing\n");
|
LogInfo("[snapshot] cleaning up unneeded background chainstate, then reinitializing");
|
||||||
if (!chainman.ValidatedSnapshotCleanup()) {
|
if (!chainman.ValidatedSnapshotCleanup()) {
|
||||||
return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Background chainstate cleanup failed unexpectedly.")};
|
return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Background chainstate cleanup failed unexpectedly.")};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& argsman, const CChainP
|
|||||||
} else if (mempool_opts.incremental_relay_feerate > mempool_opts.min_relay_feerate) {
|
} else if (mempool_opts.incremental_relay_feerate > mempool_opts.min_relay_feerate) {
|
||||||
// Allow only setting incremental fee to control both
|
// Allow only setting incremental fee to control both
|
||||||
mempool_opts.min_relay_feerate = mempool_opts.incremental_relay_feerate;
|
mempool_opts.min_relay_feerate = mempool_opts.incremental_relay_feerate;
|
||||||
LogPrintf("Increasing minrelaytxfee to %s to match incrementalrelayfee\n", mempool_opts.min_relay_feerate.ToString());
|
LogInfo("Increasing minrelaytxfee to %s to match incrementalrelayfee", mempool_opts.min_relay_feerate.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Feerate used to define dust. Shouldn't be changed lightly as old
|
// Feerate used to define dust. Shouldn't be changed lightly as old
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ uint32_t FindBestImplementation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(best.has_value());
|
assert(best.has_value());
|
||||||
LogPrintf("Using Minisketch implementation number %i\n", best->second);
|
LogInfo("Using Minisketch implementation number %i", best->second);
|
||||||
return best->second;
|
return best->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -54,7 +54,7 @@ bool noui_ThreadSafeQuestion(const bilingual_str& /* ignored interactive message
|
|||||||
|
|
||||||
void noui_InitMessage(const std::string& message)
|
void noui_InitMessage(const std::string& message)
|
||||||
{
|
{
|
||||||
LogPrintf("init message: %s\n", message);
|
LogInfo("init message: %s", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void noui_connect()
|
void noui_connect()
|
||||||
@@ -66,19 +66,19 @@ void noui_connect()
|
|||||||
|
|
||||||
bool noui_ThreadSafeMessageBoxRedirect(const bilingual_str& message, const std::string& caption, unsigned int style)
|
bool noui_ThreadSafeMessageBoxRedirect(const bilingual_str& message, const std::string& caption, unsigned int style)
|
||||||
{
|
{
|
||||||
LogPrintf("%s: %s\n", caption, message.original);
|
LogInfo("%s: %s", caption, message.original);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool noui_ThreadSafeQuestionRedirect(const bilingual_str& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
bool noui_ThreadSafeQuestionRedirect(const bilingual_str& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
||||||
{
|
{
|
||||||
LogPrintf("%s: %s\n", caption, message);
|
LogInfo("%s: %s", caption, message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void noui_InitMessageRedirect(const std::string& message)
|
void noui_InitMessageRedirect(const std::string& message)
|
||||||
{
|
{
|
||||||
LogPrintf("init message: %s\n", message);
|
LogInfo("init message: %s", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void noui_test_redirect()
|
void noui_test_redirect()
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ void noui_InitMessage(const std::string& message);
|
|||||||
/** Connect all bitcoind signal handlers */
|
/** Connect all bitcoind signal handlers */
|
||||||
void noui_connect();
|
void noui_connect();
|
||||||
|
|
||||||
/** Redirect all bitcoind signal handlers to LogPrintf. Used to check or suppress output during test runs that produce expected errors */
|
/** Redirect all bitcoind signal handlers to LogInfo. Used to check or suppress output during test runs that produce expected errors */
|
||||||
void noui_test_redirect();
|
void noui_test_redirect();
|
||||||
|
|
||||||
/** Reconnects the regular Non-GUI handlers after having used noui_test_redirect */
|
/** Reconnects the regular Non-GUI handlers after having used noui_test_redirect */
|
||||||
|
|||||||
+2
-2
@@ -561,7 +561,7 @@ CBlockPolicyEstimator::CBlockPolicyEstimator(const fs::path& estimation_filepath
|
|||||||
AutoFile est_file{fsbridge::fopen(m_estimation_filepath, "rb")};
|
AutoFile est_file{fsbridge::fopen(m_estimation_filepath, "rb")};
|
||||||
|
|
||||||
if (est_file.IsNull()) {
|
if (est_file.IsNull()) {
|
||||||
LogPrintf("%s is not found. Continue anyway.\n", fs::PathToString(m_estimation_filepath));
|
LogInfo("%s is not found. Continue anyway.", fs::PathToString(m_estimation_filepath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -971,7 +971,7 @@ void CBlockPolicyEstimator::FlushFeeEstimates()
|
|||||||
LogError("Failed to close fee estimates file %s: %s. Continuing anyway.", fs::PathToString(m_estimation_filepath), SysErrorString(errno));
|
LogError("Failed to close fee estimates file %s: %s. Continuing anyway.", fs::PathToString(m_estimation_filepath), SysErrorString(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogPrintf("Flushed fee estimates to %s.\n", fs::PathToString(m_estimation_filepath.filename()));
|
LogInfo("Flushed fee estimates to %s.", fs::PathToString(m_estimation_filepath.filename()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBlockPolicyEstimator::Write(AutoFile& fileout) const
|
bool CBlockPolicyEstimator::Write(AutoFile& fileout) const
|
||||||
|
|||||||
+1
-1
@@ -190,7 +190,7 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
|
|||||||
if (type == QtDebugMsg) {
|
if (type == QtDebugMsg) {
|
||||||
LogDebug(BCLog::QT, "GUI: %s\n", msg.toStdString());
|
LogDebug(BCLog::QT, "GUI: %s\n", msg.toStdString());
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("GUI: %s\n", msg.toStdString());
|
LogInfo("GUI: %s", msg.toStdString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -107,10 +107,10 @@ void ReportHardwareRand()
|
|||||||
// This must be done in a separate function, as InitHardwareRand() may be indirectly called
|
// This must be done in a separate function, as InitHardwareRand() may be indirectly called
|
||||||
// from global constructors, before logging is initialized.
|
// from global constructors, before logging is initialized.
|
||||||
if (g_rdseed_supported) {
|
if (g_rdseed_supported) {
|
||||||
LogPrintf("Using RdSeed as an additional entropy source\n");
|
LogInfo("Using RdSeed as an additional entropy source");
|
||||||
}
|
}
|
||||||
if (g_rdrand_supported) {
|
if (g_rdrand_supported) {
|
||||||
LogPrintf("Using RdRand as an additional entropy source\n");
|
LogInfo("Using RdRand as an additional entropy source");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ SignatureCache::SignatureCache(const size_t max_size_bytes)
|
|||||||
m_salted_hasher_schnorr.Write(PADDING_SCHNORR, 32);
|
m_salted_hasher_schnorr.Write(PADDING_SCHNORR, 32);
|
||||||
|
|
||||||
const auto [num_elems, approx_size_bytes] = setValid.setup_bytes(max_size_bytes);
|
const auto [num_elems, approx_size_bytes] = setValid.setup_bytes(max_size_bytes);
|
||||||
LogPrintf("Using %zu MiB out of %zu MiB requested for signature cache, able to store %zu elements\n",
|
LogInfo("Using %zu MiB out of %zu MiB requested for signature cache, able to store %zu elements",
|
||||||
approx_size_bytes >> 20, max_size_bytes >> 20, num_elems);
|
approx_size_bytes >> 20, max_size_bytes >> 20, num_elems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void IpcPipeTest()
|
|||||||
std::promise<std::unique_ptr<mp::ProxyClient<gen::FooInterface>>> foo_promise;
|
std::promise<std::unique_ptr<mp::ProxyClient<gen::FooInterface>>> foo_promise;
|
||||||
std::function<void()> disconnect_client;
|
std::function<void()> disconnect_client;
|
||||||
std::thread thread([&]() {
|
std::thread thread([&]() {
|
||||||
mp::EventLoop loop("IpcPipeTest", [](bool raise, const std::string& log) { LogPrintf("LOG%i: %s\n", raise, log); });
|
mp::EventLoop loop("IpcPipeTest", [](bool raise, const std::string& log) { LogInfo("LOG%i: %s", raise, log); });
|
||||||
auto pipe = loop.m_io_context.provider->newTwoWayPipe();
|
auto pipe = loop.m_io_context.provider->newTwoWayPipe();
|
||||||
|
|
||||||
auto connection_client = std::make_unique<mp::Connection>(loop, kj::mv(pipe.ends[0]));
|
auto connection_client = std::make_unique<mp::Connection>(loop, kj::mv(pipe.ends[0]));
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ struct LogSetup : public BasicTestingSetup {
|
|||||||
~LogSetup()
|
~LogSetup()
|
||||||
{
|
{
|
||||||
LogInstance().m_file_path = prev_log_path;
|
LogInstance().m_file_path = prev_log_path;
|
||||||
LogPrintf("Sentinel log to reopen log file\n");
|
LogInfo("Sentinel log to reopen log file");
|
||||||
LogInstance().m_print_to_file = prev_print_to_file;
|
LogInstance().m_print_to_file = prev_print_to_file;
|
||||||
LogInstance().m_reopen_file = prev_reopen_file;
|
LogInstance().m_reopen_file = prev_reopen_file;
|
||||||
LogInstance().m_log_timestamps = prev_log_timestamps;
|
LogInstance().m_log_timestamps = prev_log_timestamps;
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ CreateAndActivateUTXOSnapshot(
|
|||||||
std::move(auto_outfile), // Will close auto_outfile.
|
std::move(auto_outfile), // Will close auto_outfile.
|
||||||
snapshot_path,
|
snapshot_path,
|
||||||
snapshot_path);
|
snapshot_path);
|
||||||
LogPrintf(
|
LogInfo("Wrote UTXO snapshot to %s: %s",
|
||||||
"Wrote UTXO snapshot to %s: %s\n", fs::PathToString(snapshot_path.make_preferred()), result.write());
|
fs::PathToString(snapshot_path.make_preferred()), result.write());
|
||||||
|
|
||||||
// Read the written snapshot in and then activate it.
|
// Read the written snapshot in and then activate it.
|
||||||
//
|
//
|
||||||
|
|||||||
+1
-1
@@ -205,7 +205,7 @@ std::vector<bool> DecodeAsmap(fs::path path)
|
|||||||
}
|
}
|
||||||
file.seek(0, SEEK_END);
|
file.seek(0, SEEK_END);
|
||||||
int length = file.tell();
|
int length = file.tell();
|
||||||
LogPrintf("Opened asmap file %s (%d bytes) from disk\n", fs::quoted(fs::PathToString(path)), length);
|
LogInfo("Opened asmap file %s (%d bytes) from disk", fs::quoted(fs::PathToString(path)), length);
|
||||||
file.seek(0, SEEK_SET);
|
file.seek(0, SEEK_SET);
|
||||||
uint8_t cur_byte;
|
uint8_t cur_byte;
|
||||||
for (int i = 0; i < length; ++i) {
|
for (int i = 0; i < length; ++i) {
|
||||||
|
|||||||
+2
-2
@@ -17,9 +17,9 @@ void util::TraceThread(std::string_view thread_name, std::function<void()> threa
|
|||||||
{
|
{
|
||||||
util::ThreadRename(std::string{thread_name});
|
util::ThreadRename(std::string{thread_name});
|
||||||
try {
|
try {
|
||||||
LogPrintf("%s thread start\n", thread_name);
|
LogInfo("%s thread start", thread_name);
|
||||||
thread_func();
|
thread_func();
|
||||||
LogPrintf("%s thread exit\n", thread_name);
|
LogInfo("%s thread exit", thread_name);
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
PrintExceptionContinue(&e, thread_name);
|
PrintExceptionContinue(&e, thread_name);
|
||||||
throw;
|
throw;
|
||||||
|
|||||||
+33
-33
@@ -2035,7 +2035,7 @@ bool ChainstateManager::IsInitialBlockDownload() const
|
|||||||
if (chain.Tip()->Time() < Now<NodeSeconds>() - m_options.max_tip_age) {
|
if (chain.Tip()->Time() < Now<NodeSeconds>() - m_options.max_tip_age) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
LogPrintf("Leaving InitialBlockDownload (latching to false)\n");
|
LogInfo("Leaving InitialBlockDownload (latching to false)");
|
||||||
m_cached_finished_ibd.store(true, std::memory_order_relaxed);
|
m_cached_finished_ibd.store(true, std::memory_order_relaxed);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2136,7 +2136,7 @@ ValidationCache::ValidationCache(const size_t script_execution_cache_bytes, cons
|
|||||||
m_script_execution_cache_hasher.Write(nonce.begin(), 32);
|
m_script_execution_cache_hasher.Write(nonce.begin(), 32);
|
||||||
|
|
||||||
const auto [num_elems, approx_size_bytes] = m_script_execution_cache.setup_bytes(script_execution_cache_bytes);
|
const auto [num_elems, approx_size_bytes] = m_script_execution_cache.setup_bytes(script_execution_cache_bytes);
|
||||||
LogPrintf("Using %zu MiB out of %zu MiB requested for script execution cache, able to store %zu elements\n",
|
LogInfo("Using %zu MiB out of %zu MiB requested for script execution cache, able to store %zu elements",
|
||||||
approx_size_bytes >> 20, script_execution_cache_bytes >> 20, num_elems);
|
approx_size_bytes >> 20, script_execution_cache_bytes >> 20, num_elems);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4695,7 +4695,7 @@ bool Chainstate::LoadChainTip()
|
|||||||
PruneBlockIndexCandidates();
|
PruneBlockIndexCandidates();
|
||||||
|
|
||||||
tip = m_chain.Tip();
|
tip = m_chain.Tip();
|
||||||
LogPrintf("Loaded best chain: hashBestChain=%s height=%d date=%s progress=%f\n",
|
LogInfo("Loaded best chain: hashBestChain=%s height=%d date=%s progress=%f",
|
||||||
tip->GetBlockHash().ToString(),
|
tip->GetBlockHash().ToString(),
|
||||||
m_chain.Height(),
|
m_chain.Height(),
|
||||||
FormatISO8601DateTime(tip->GetBlockTime()),
|
FormatISO8601DateTime(tip->GetBlockTime()),
|
||||||
@@ -4741,7 +4741,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
nCheckDepth = chainstate.m_chain.Height();
|
nCheckDepth = chainstate.m_chain.Height();
|
||||||
}
|
}
|
||||||
nCheckLevel = std::max(0, std::min(4, nCheckLevel));
|
nCheckLevel = std::max(0, std::min(4, nCheckLevel));
|
||||||
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);
|
LogInfo("Verifying last %i blocks at level %i", nCheckDepth, nCheckLevel);
|
||||||
CCoinsViewCache coins(&coinsview);
|
CCoinsViewCache coins(&coinsview);
|
||||||
CBlockIndex* pindex;
|
CBlockIndex* pindex;
|
||||||
CBlockIndex* pindexFailure = nullptr;
|
CBlockIndex* pindexFailure = nullptr;
|
||||||
@@ -4750,7 +4750,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
int reportDone = 0;
|
int reportDone = 0;
|
||||||
bool skipped_no_block_data{false};
|
bool skipped_no_block_data{false};
|
||||||
bool skipped_l3_checks{false};
|
bool skipped_l3_checks{false};
|
||||||
LogPrintf("Verification progress: 0%%\n");
|
LogInfo("Verification progress: 0%%");
|
||||||
|
|
||||||
const bool is_snapshot_cs{chainstate.m_from_snapshot_blockhash};
|
const bool is_snapshot_cs{chainstate.m_from_snapshot_blockhash};
|
||||||
|
|
||||||
@@ -4758,7 +4758,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
const int percentageDone = std::max(1, std::min(99, (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
|
const int percentageDone = std::max(1, std::min(99, (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
|
||||||
if (reportDone < percentageDone / 10) {
|
if (reportDone < percentageDone / 10) {
|
||||||
// report every 10% step
|
// report every 10% step
|
||||||
LogPrintf("Verification progress: %d%%\n", percentageDone);
|
LogInfo("Verification progress: %d%%", percentageDone);
|
||||||
reportDone = percentageDone / 10;
|
reportDone = percentageDone / 10;
|
||||||
}
|
}
|
||||||
m_notifications.progress(_("Verifying blocks…"), percentageDone, false);
|
m_notifications.progress(_("Verifying blocks…"), percentageDone, false);
|
||||||
@@ -4768,7 +4768,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
if ((chainstate.m_blockman.IsPruneMode() || is_snapshot_cs) && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
|
if ((chainstate.m_blockman.IsPruneMode() || is_snapshot_cs) && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
|
||||||
// If pruning or running under an assumeutxo snapshot, only go
|
// If pruning or running under an assumeutxo snapshot, only go
|
||||||
// back as far as we have data.
|
// back as far as we have data.
|
||||||
LogPrintf("VerifyDB(): block verification stopping at height %d (no data). This could be due to pruning or use of an assumeutxo snapshot.\n", pindex->nHeight);
|
LogInfo("Block verification stopping at height %d (no data). This could be due to pruning or use of an assumeutxo snapshot.", pindex->nHeight);
|
||||||
skipped_no_block_data = true;
|
skipped_no_block_data = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4834,7 +4834,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
const int percentageDone = std::max(1, std::min(99, 100 - (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * 50)));
|
const int percentageDone = std::max(1, std::min(99, 100 - (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * 50)));
|
||||||
if (reportDone < percentageDone / 10) {
|
if (reportDone < percentageDone / 10) {
|
||||||
// report every 10% step
|
// report every 10% step
|
||||||
LogPrintf("Verification progress: %d%%\n", percentageDone);
|
LogInfo("Verification progress: %d%%", percentageDone);
|
||||||
reportDone = percentageDone / 10;
|
reportDone = percentageDone / 10;
|
||||||
}
|
}
|
||||||
m_notifications.progress(_("Verifying blocks…"), percentageDone, false);
|
m_notifications.progress(_("Verifying blocks…"), percentageDone, false);
|
||||||
@@ -4852,7 +4852,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("Verification: No coin database inconsistencies in last %i blocks (%i transactions)\n", block_count, nGoodTransactions);
|
LogInfo("Verification: No coin database inconsistencies in last %i blocks (%i transactions)", block_count, nGoodTransactions);
|
||||||
|
|
||||||
if (skipped_l3_checks) {
|
if (skipped_l3_checks) {
|
||||||
return VerifyDBResult::SKIPPED_L3_CHECKS;
|
return VerifyDBResult::SKIPPED_L3_CHECKS;
|
||||||
@@ -4901,7 +4901,7 @@ bool Chainstate::ReplayBlocks()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_chainman.GetNotifications().progress(_("Replaying blocks…"), 0, false);
|
m_chainman.GetNotifications().progress(_("Replaying blocks…"), 0, false);
|
||||||
LogPrintf("Replaying blocks\n");
|
LogInfo("Replaying blocks");
|
||||||
|
|
||||||
const CBlockIndex* pindexOld = nullptr; // Old tip during the interrupted flush.
|
const CBlockIndex* pindexOld = nullptr; // Old tip during the interrupted flush.
|
||||||
const CBlockIndex* pindexNew; // New tip during the interrupted flush.
|
const CBlockIndex* pindexNew; // New tip during the interrupted flush.
|
||||||
@@ -4931,7 +4931,7 @@ bool Chainstate::ReplayBlocks()
|
|||||||
LogError("RollbackBlock(): ReadBlock() failed at %d, hash=%s\n", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());
|
LogError("RollbackBlock(): ReadBlock() failed at %d, hash=%s\n", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LogPrintf("Rolling back %s (%i)\n", pindexOld->GetBlockHash().ToString(), pindexOld->nHeight);
|
LogInfo("Rolling back %s (%i)", pindexOld->GetBlockHash().ToString(), pindexOld->nHeight);
|
||||||
DisconnectResult res = DisconnectBlock(block, pindexOld, cache);
|
DisconnectResult res = DisconnectBlock(block, pindexOld, cache);
|
||||||
if (res == DISCONNECT_FAILED) {
|
if (res == DISCONNECT_FAILED) {
|
||||||
LogError("RollbackBlock(): DisconnectBlock failed at %d, hash=%s\n", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());
|
LogError("RollbackBlock(): DisconnectBlock failed at %d, hash=%s\n", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());
|
||||||
@@ -4950,7 +4950,7 @@ bool Chainstate::ReplayBlocks()
|
|||||||
for (int nHeight = nForkHeight + 1; nHeight <= pindexNew->nHeight; ++nHeight) {
|
for (int nHeight = nForkHeight + 1; nHeight <= pindexNew->nHeight; ++nHeight) {
|
||||||
const CBlockIndex& pindex{*Assert(pindexNew->GetAncestor(nHeight))};
|
const CBlockIndex& pindex{*Assert(pindexNew->GetAncestor(nHeight))};
|
||||||
|
|
||||||
LogPrintf("Rolling forward %s (%i)\n", pindex.GetBlockHash().ToString(), nHeight);
|
LogInfo("Rolling forward %s (%i)", pindex.GetBlockHash().ToString(), nHeight);
|
||||||
m_chainman.GetNotifications().progress(_("Replaying blocks…"), (int)((nHeight - nForkHeight) * 100.0 / (pindexNew->nHeight - nForkHeight)), false);
|
m_chainman.GetNotifications().progress(_("Replaying blocks…"), (int)((nHeight - nForkHeight) * 100.0 / (pindexNew->nHeight - nForkHeight)), false);
|
||||||
if (!RollforwardBlock(&pindex, cache)) return false;
|
if (!RollforwardBlock(&pindex, cache)) return false;
|
||||||
}
|
}
|
||||||
@@ -5228,7 +5228,7 @@ void ChainstateManager::LoadExternalBlockFile(
|
|||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
GetNotifications().fatalError(strprintf(_("System error while loading external block file: %s"), e.what()));
|
GetNotifications().fatalError(strprintf(_("System error while loading external block file: %s"), e.what()));
|
||||||
}
|
}
|
||||||
LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
LogInfo("Loaded %i blocks from external file in %dms", nLoaded, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChainstateManager::ShouldCheckBlockIndex() const
|
bool ChainstateManager::ShouldCheckBlockIndex() const
|
||||||
@@ -5578,9 +5578,9 @@ bool Chainstate::ResizeCoinsCaches(size_t coinstip_size, size_t coinsdb_size)
|
|||||||
m_coinsdb_cache_size_bytes = coinsdb_size;
|
m_coinsdb_cache_size_bytes = coinsdb_size;
|
||||||
CoinsDB().ResizeCache(coinsdb_size);
|
CoinsDB().ResizeCache(coinsdb_size);
|
||||||
|
|
||||||
LogPrintf("[%s] resized coinsdb cache to %.1f MiB\n",
|
LogInfo("[%s] resized coinsdb cache to %.1f MiB",
|
||||||
this->ToString(), coinsdb_size * (1.0 / 1024 / 1024));
|
this->ToString(), coinsdb_size * (1.0 / 1024 / 1024));
|
||||||
LogPrintf("[%s] resized coinstip cache to %.1f MiB\n",
|
LogInfo("[%s] resized coinstip cache to %.1f MiB",
|
||||||
this->ToString(), coinstip_size * (1.0 / 1024 / 1024));
|
this->ToString(), coinstip_size * (1.0 / 1024 / 1024));
|
||||||
|
|
||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
@@ -5687,7 +5687,7 @@ Chainstate& ChainstateManager::InitializeChainstate(CTxMemPool* mempool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string path_str = fs::PathToString(db_path);
|
std::string path_str = fs::PathToString(db_path);
|
||||||
LogPrintf("Removing leveldb dir at %s\n", path_str);
|
LogInfo("Removing leveldb dir at %s\n", path_str);
|
||||||
|
|
||||||
// We have to destruct before this call leveldb::DB in order to release the db
|
// We have to destruct before this call leveldb::DB in order to release the db
|
||||||
// lock, otherwise `DestroyDB` will fail. See `leveldb::~DBImpl()`.
|
// lock, otherwise `DestroyDB` will fail. See `leveldb::~DBImpl()`.
|
||||||
@@ -5850,8 +5850,8 @@ util::Result<CBlockIndex*> ChainstateManager::ActivateSnapshot(
|
|||||||
m_active_chainstate = m_snapshot_chainstate.get();
|
m_active_chainstate = m_snapshot_chainstate.get();
|
||||||
m_blockman.m_snapshot_height = this->GetSnapshotBaseHeight();
|
m_blockman.m_snapshot_height = this->GetSnapshotBaseHeight();
|
||||||
|
|
||||||
LogPrintf("[snapshot] successfully activated snapshot %s\n", base_blockhash.ToString());
|
LogInfo("[snapshot] successfully activated snapshot %s", base_blockhash.ToString());
|
||||||
LogPrintf("[snapshot] (%.2f MB)\n",
|
LogInfo("[snapshot] (%.2f MB)",
|
||||||
m_snapshot_chainstate->CoinsTip().DynamicMemoryUsage() / (1000 * 1000));
|
m_snapshot_chainstate->CoinsTip().DynamicMemoryUsage() / (1000 * 1000));
|
||||||
|
|
||||||
this->MaybeRebalanceCaches();
|
this->MaybeRebalanceCaches();
|
||||||
@@ -5922,7 +5922,7 @@ util::Result<void> ChainstateManager::PopulateAndValidateSnapshot(
|
|||||||
const uint64_t coins_count = metadata.m_coins_count;
|
const uint64_t coins_count = metadata.m_coins_count;
|
||||||
uint64_t coins_left = metadata.m_coins_count;
|
uint64_t coins_left = metadata.m_coins_count;
|
||||||
|
|
||||||
LogPrintf("[snapshot] loading %d coins from snapshot %s\n", coins_left, base_blockhash.ToString());
|
LogInfo("[snapshot] loading %d coins from snapshot %s", coins_left, base_blockhash.ToString());
|
||||||
int64_t coins_processed{0};
|
int64_t coins_processed{0};
|
||||||
|
|
||||||
while (coins_left > 0) {
|
while (coins_left > 0) {
|
||||||
@@ -5958,7 +5958,7 @@ util::Result<void> ChainstateManager::PopulateAndValidateSnapshot(
|
|||||||
++coins_processed;
|
++coins_processed;
|
||||||
|
|
||||||
if (coins_processed % 1000000 == 0) {
|
if (coins_processed % 1000000 == 0) {
|
||||||
LogPrintf("[snapshot] %d coins loaded (%.2f%%, %.2f MB)\n",
|
LogInfo("[snapshot] %d coins loaded (%.2f%%, %.2f MB)",
|
||||||
coins_processed,
|
coins_processed,
|
||||||
static_cast<float>(coins_processed) * 100 / static_cast<float>(coins_count),
|
static_cast<float>(coins_processed) * 100 / static_cast<float>(coins_count),
|
||||||
coins_cache.DynamicMemoryUsage() / (1000 * 1000));
|
coins_cache.DynamicMemoryUsage() / (1000 * 1000));
|
||||||
@@ -6013,7 +6013,7 @@ util::Result<void> ChainstateManager::PopulateAndValidateSnapshot(
|
|||||||
coins_count))};
|
coins_count))};
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("[snapshot] loaded %d (%.2f MB) coins from snapshot %s\n",
|
LogInfo("[snapshot] loaded %d (%.2f MB) coins from snapshot %s",
|
||||||
coins_count,
|
coins_count,
|
||||||
coins_cache.DynamicMemoryUsage() / (1000 * 1000),
|
coins_cache.DynamicMemoryUsage() / (1000 * 1000),
|
||||||
base_blockhash.ToString());
|
base_blockhash.ToString());
|
||||||
@@ -6080,7 +6080,7 @@ util::Result<void> ChainstateManager::PopulateAndValidateSnapshot(
|
|||||||
index->m_chain_tx_count = au_data.m_chain_tx_count;
|
index->m_chain_tx_count = au_data.m_chain_tx_count;
|
||||||
snapshot_chainstate.setBlockIndexCandidates.insert(snapshot_start_block);
|
snapshot_chainstate.setBlockIndexCandidates.insert(snapshot_start_block);
|
||||||
|
|
||||||
LogPrintf("[snapshot] validated snapshot (%.2f MB)\n",
|
LogInfo("[snapshot] validated snapshot (%.2f MB)",
|
||||||
coins_cache.DynamicMemoryUsage() / (1000 * 1000));
|
coins_cache.DynamicMemoryUsage() / (1000 * 1000));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -6184,8 +6184,8 @@ SnapshotCompletionResult ChainstateManager::MaybeCompleteSnapshotValidation()
|
|||||||
|
|
||||||
const AssumeutxoData& au_data = *maybe_au_data;
|
const AssumeutxoData& au_data = *maybe_au_data;
|
||||||
std::optional<CCoinsStats> maybe_ibd_stats;
|
std::optional<CCoinsStats> maybe_ibd_stats;
|
||||||
LogPrintf("[snapshot] computing UTXO stats for background chainstate to validate "
|
LogInfo("[snapshot] computing UTXO stats for background chainstate to validate "
|
||||||
"snapshot - this could take a few minutes\n");
|
"snapshot - this could take a few minutes");
|
||||||
try {
|
try {
|
||||||
maybe_ibd_stats = ComputeUTXOStats(
|
maybe_ibd_stats = ComputeUTXOStats(
|
||||||
CoinStatsHashType::HASH_SERIALIZED,
|
CoinStatsHashType::HASH_SERIALIZED,
|
||||||
@@ -6221,7 +6221,7 @@ SnapshotCompletionResult ChainstateManager::MaybeCompleteSnapshotValidation()
|
|||||||
return SnapshotCompletionResult::HASH_MISMATCH;
|
return SnapshotCompletionResult::HASH_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("[snapshot] snapshot beginning at %s has been fully validated\n",
|
LogInfo("[snapshot] snapshot beginning at %s has been fully validated",
|
||||||
snapshot_blockhash.ToString());
|
snapshot_blockhash.ToString());
|
||||||
|
|
||||||
m_ibd_chainstate->m_disabled = true;
|
m_ibd_chainstate->m_disabled = true;
|
||||||
@@ -6257,7 +6257,7 @@ void ChainstateManager::MaybeRebalanceCaches()
|
|||||||
}
|
}
|
||||||
else if (snapshot_usable && !ibd_usable) {
|
else if (snapshot_usable && !ibd_usable) {
|
||||||
// If background validation has completed and snapshot is our active chain...
|
// If background validation has completed and snapshot is our active chain...
|
||||||
LogPrintf("[snapshot] allocating all cache to the snapshot chainstate\n");
|
LogInfo("[snapshot] allocating all cache to the snapshot chainstate");
|
||||||
// Allocate everything to the snapshot chainstate.
|
// Allocate everything to the snapshot chainstate.
|
||||||
m_snapshot_chainstate->ResizeCoinsCaches(m_total_coinstip_cache, m_total_coinsdb_cache);
|
m_snapshot_chainstate->ResizeCoinsCaches(m_total_coinstip_cache, m_total_coinsdb_cache);
|
||||||
}
|
}
|
||||||
@@ -6326,7 +6326,7 @@ bool ChainstateManager::DetectSnapshotChainstate()
|
|||||||
if (!base_blockhash) {
|
if (!base_blockhash) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LogPrintf("[snapshot] detected active snapshot chainstate (%s) - loading\n",
|
LogInfo("[snapshot] detected active snapshot chainstate (%s) - loading",
|
||||||
fs::PathToString(*path));
|
fs::PathToString(*path));
|
||||||
|
|
||||||
this->ActivateExistingSnapshot(*base_blockhash);
|
this->ActivateExistingSnapshot(*base_blockhash);
|
||||||
@@ -6338,7 +6338,7 @@ Chainstate& ChainstateManager::ActivateExistingSnapshot(uint256 base_blockhash)
|
|||||||
assert(!m_snapshot_chainstate);
|
assert(!m_snapshot_chainstate);
|
||||||
m_snapshot_chainstate =
|
m_snapshot_chainstate =
|
||||||
std::make_unique<Chainstate>(nullptr, m_blockman, *this, base_blockhash);
|
std::make_unique<Chainstate>(nullptr, m_blockman, *this, base_blockhash);
|
||||||
LogPrintf("[snapshot] switching active chainstate to %s\n", m_snapshot_chainstate->ToString());
|
LogInfo("[snapshot] switching active chainstate to %s", m_snapshot_chainstate->ToString());
|
||||||
|
|
||||||
// Mempool is empty at this point because we're still in IBD.
|
// Mempool is empty at this point because we're still in IBD.
|
||||||
Assert(m_active_chainstate->m_mempool->size() == 0);
|
Assert(m_active_chainstate->m_mempool->size() == 0);
|
||||||
@@ -6382,7 +6382,7 @@ util::Result<void> Chainstate::InvalidateCoinsDBOnDisk()
|
|||||||
auto invalid_path = snapshot_datadir + "_INVALID";
|
auto invalid_path = snapshot_datadir + "_INVALID";
|
||||||
std::string dbpath = fs::PathToString(snapshot_datadir);
|
std::string dbpath = fs::PathToString(snapshot_datadir);
|
||||||
std::string target = fs::PathToString(invalid_path);
|
std::string target = fs::PathToString(invalid_path);
|
||||||
LogPrintf("[snapshot] renaming snapshot datadir %s to %s\n", dbpath, target);
|
LogInfo("[snapshot] renaming snapshot datadir %s to %s", dbpath, target);
|
||||||
|
|
||||||
// The invalid snapshot datadir is simply moved and not deleted because we may
|
// The invalid snapshot datadir is simply moved and not deleted because we may
|
||||||
// want to do forensics later during issue investigation. The user is instructed
|
// want to do forensics later during issue investigation. The user is instructed
|
||||||
@@ -6494,7 +6494,7 @@ bool ChainstateManager::ValidatedSnapshotCleanup()
|
|||||||
// No chainstates should be considered usable.
|
// No chainstates should be considered usable.
|
||||||
assert(this->GetAll().size() == 0);
|
assert(this->GetAll().size() == 0);
|
||||||
|
|
||||||
LogPrintf("[snapshot] deleting background chainstate directory (now unnecessary) (%s)\n",
|
LogInfo("[snapshot] deleting background chainstate directory (now unnecessary) (%s)",
|
||||||
fs::PathToString(ibd_chainstate_path));
|
fs::PathToString(ibd_chainstate_path));
|
||||||
|
|
||||||
fs::path tmp_old{ibd_chainstate_path + "_todelete"};
|
fs::path tmp_old{ibd_chainstate_path + "_todelete"};
|
||||||
@@ -6518,8 +6518,8 @@ bool ChainstateManager::ValidatedSnapshotCleanup()
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("[snapshot] moving snapshot chainstate (%s) to "
|
LogInfo("[snapshot] moving snapshot chainstate (%s) to "
|
||||||
"default chainstate directory (%s)\n",
|
"default chainstate directory (%s)",
|
||||||
fs::PathToString(snapshot_chainstate_path), fs::PathToString(ibd_chainstate_path));
|
fs::PathToString(snapshot_chainstate_path), fs::PathToString(ibd_chainstate_path));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -6536,7 +6536,7 @@ bool ChainstateManager::ValidatedSnapshotCleanup()
|
|||||||
"directory is now unnecessary.\n",
|
"directory is now unnecessary.\n",
|
||||||
fs::PathToString(tmp_old));
|
fs::PathToString(tmp_old));
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("[snapshot] deleted background chainstate directory (%s)\n",
|
LogInfo("[snapshot] deleted background chainstate directory (%s)",
|
||||||
fs::PathToString(ibd_chainstate_path));
|
fs::PathToString(ibd_chainstate_path));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+3
-3
@@ -88,14 +88,14 @@ bool WalletInit::ParameterInteraction() const
|
|||||||
{
|
{
|
||||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
||||||
for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
|
for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
|
||||||
LogPrintf("%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\n", __func__, wallet);
|
LogInfo("Parameter interaction: -disablewallet -> ignoring -wallet=%s", wallet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
|
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
|
||||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
|
LogInfo("Parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -105,7 +105,7 @@ void WalletInit::Construct(NodeContext& node) const
|
|||||||
{
|
{
|
||||||
ArgsManager& args = *Assert(node.args);
|
ArgsManager& args = *Assert(node.args);
|
||||||
if (args.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
if (args.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
||||||
LogPrintf("Wallet disabled!\n");
|
LogInfo("Wallet disabled!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto wallet_loader = node.init->makeWalletLoader(*node.chain);
|
auto wallet_loader = node.init->makeWalletLoader(*node.chain);
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ bool VerifyWallets(WalletContext& context)
|
|||||||
args.ForceSetArg("-walletdir", fs::PathToString(canonical_wallet_dir));
|
args.ForceSetArg("-walletdir", fs::PathToString(canonical_wallet_dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("Using wallet directory %s\n", fs::PathToString(GetWalletDir()));
|
LogInfo("Using wallet directory %s", fs::PathToString(GetWalletDir()));
|
||||||
|
|
||||||
chain.initMessage(_("Verifying wallet(s)…"));
|
chain.initMessage(_("Verifying wallet(s)…"));
|
||||||
|
|
||||||
|
|||||||
@@ -116,8 +116,8 @@ SQLiteDatabase::SQLiteDatabase(const fs::path& dir_path, const fs::path& file_pa
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
LOCK(g_sqlite_mutex);
|
LOCK(g_sqlite_mutex);
|
||||||
LogPrintf("Using SQLite Version %s\n", SQLiteDatabaseVersion());
|
LogInfo("Using SQLite Version %s", SQLiteDatabaseVersion());
|
||||||
LogPrintf("Using wallet %s\n", fs::PathToString(m_dir_path));
|
LogInfo("Using wallet %s", fs::PathToString(m_dir_path));
|
||||||
|
|
||||||
if (++g_sqlite_count == 1) {
|
if (++g_sqlite_count == 1) {
|
||||||
// Setup logging
|
// Setup logging
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class PruneTest(BitcoinTestFramework):
|
|||||||
def reorg_back(self):
|
def reorg_back(self):
|
||||||
# Verify that a block on the old main chain fork has been pruned away
|
# Verify that a block on the old main chain fork has been pruned away
|
||||||
assert_raises_rpc_error(-1, "Block not available (pruned data)", self.nodes[2].getblock, self.forkhash)
|
assert_raises_rpc_error(-1, "Block not available (pruned data)", self.nodes[2].getblock, self.forkhash)
|
||||||
with self.nodes[2].assert_debug_log(expected_msgs=['block verification stopping at height', '(no data)']):
|
with self.nodes[2].assert_debug_log(expected_msgs=["Block verification stopping at height", "(no data)"]):
|
||||||
assert not self.nodes[2].verifychain(checklevel=4, nblocks=0)
|
assert not self.nodes[2].verifychain(checklevel=4, nblocks=0)
|
||||||
self.log.info(f"Will need to redownload block {self.forkheight}")
|
self.log.info(f"Will need to redownload block {self.forkheight}")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user