mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-14 05:42:36 -03:00
refactor: Consistently use args over gArgs in init.cpp
This commit is contained in:
parent
fa891120c8
commit
fa3e9b420f
1 changed files with 8 additions and 8 deletions
16
src/init.cpp
16
src/init.cpp
|
@ -867,7 +867,7 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
|
||||||
InitWarning(warnings);
|
InitWarning(warnings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs::is_directory(gArgs.GetBlocksDirPath())) {
|
if (!fs::is_directory(args.GetBlocksDirPath())) {
|
||||||
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), args.GetArg("-blocksdir", "")));
|
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), args.GetArg("-blocksdir", "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1224,7 +1224,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
if (args.IsArgSet("-asmap")) {
|
if (args.IsArgSet("-asmap")) {
|
||||||
fs::path asmap_path = args.GetPathArg("-asmap", DEFAULT_ASMAP_FILENAME);
|
fs::path asmap_path = args.GetPathArg("-asmap", DEFAULT_ASMAP_FILENAME);
|
||||||
if (!asmap_path.is_absolute()) {
|
if (!asmap_path.is_absolute()) {
|
||||||
asmap_path = gArgs.GetDataDirNet() / asmap_path;
|
asmap_path = args.GetDataDirNet() / asmap_path;
|
||||||
}
|
}
|
||||||
if (!fs::exists(asmap_path)) {
|
if (!fs::exists(asmap_path)) {
|
||||||
InitError(strprintf(_("Could not find asmap file %s"), fs::quoted(fs::PathToString(asmap_path))));
|
InitError(strprintf(_("Could not find asmap file %s"), fs::quoted(fs::PathToString(asmap_path))));
|
||||||
|
@ -1254,7 +1254,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!node.banman);
|
assert(!node.banman);
|
||||||
node.banman = std::make_unique<BanMan>(gArgs.GetDataDirNet() / "banlist", &uiInterface, args.GetIntArg("-bantime", DEFAULT_MISBEHAVING_BANTIME));
|
node.banman = std::make_unique<BanMan>(args.GetDataDirNet() / "banlist", &uiInterface, args.GetIntArg("-bantime", DEFAULT_MISBEHAVING_BANTIME));
|
||||||
assert(!node.connman);
|
assert(!node.connman);
|
||||||
node.connman = std::make_unique<CConnman>(GetRand<uint64_t>(),
|
node.connman = std::make_unique<CConnman>(GetRand<uint64_t>(),
|
||||||
GetRand<uint64_t>(),
|
GetRand<uint64_t>(),
|
||||||
|
@ -1618,12 +1618,12 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
|
|
||||||
// ********************************************************* Step 11: import blocks
|
// ********************************************************* Step 11: import blocks
|
||||||
|
|
||||||
if (!CheckDiskSpace(gArgs.GetDataDirNet())) {
|
if (!CheckDiskSpace(args.GetDataDirNet())) {
|
||||||
InitError(strprintf(_("Error: Disk space is low for %s"), fs::quoted(fs::PathToString(gArgs.GetDataDirNet()))));
|
InitError(strprintf(_("Error: Disk space is low for %s"), fs::quoted(fs::PathToString(args.GetDataDirNet()))));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!CheckDiskSpace(gArgs.GetBlocksDirPath())) {
|
if (!CheckDiskSpace(args.GetBlocksDirPath())) {
|
||||||
InitError(strprintf(_("Error: Disk space is low for %s"), fs::quoted(fs::PathToString(gArgs.GetBlocksDirPath()))));
|
InitError(strprintf(_("Error: Disk space is low for %s"), fs::quoted(fs::PathToString(args.GetBlocksDirPath()))));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1715,7 +1715,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||||
if (node.peerman) node.peerman->SetBestHeight(chain_active_height);
|
if (node.peerman) node.peerman->SetBestHeight(chain_active_height);
|
||||||
|
|
||||||
// Map ports with UPnP or NAT-PMP.
|
// Map ports with UPnP or NAT-PMP.
|
||||||
StartMapPort(args.GetBoolArg("-upnp", DEFAULT_UPNP), gArgs.GetBoolArg("-natpmp", DEFAULT_NATPMP));
|
StartMapPort(args.GetBoolArg("-upnp", DEFAULT_UPNP), args.GetBoolArg("-natpmp", DEFAULT_NATPMP));
|
||||||
|
|
||||||
CConnman::Options connOptions;
|
CConnman::Options connOptions;
|
||||||
connOptions.nLocalServices = nLocalServices;
|
connOptions.nLocalServices = nLocalServices;
|
||||||
|
|
Loading…
Reference in a new issue