@@ -1015,7 +1015,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
10151015static bool LockDataDirectory (bool probeOnly)
10161016{
10171017 // Make sure only a single Bitcoin process is using the data directory.
1018- fs::path datadir = GetDataDir ();
1018+ fs::path datadir = gArgs . GetDataDirNet ();
10191019 if (!DirIsWritable (datadir)) {
10201020 return InitError (strprintf (_ (" Cannot write to data directory '%s'; check permissions." ), datadir.string ()));
10211021 }
@@ -1166,7 +1166,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
11661166 assert (!node.addrman );
11671167 node.addrman = std::make_unique<CAddrMan>();
11681168 assert (!node.banman );
1169- node.banman = std::make_unique<BanMan>(GetDataDir () / " banlist.dat" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
1169+ node.banman = std::make_unique<BanMan>(gArgs . GetDataDirNet () / " banlist.dat" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
11701170 assert (!node.connman );
11711171 node.connman = std::make_unique<CConnman>(GetRand (std::numeric_limits<uint64_t >::max ()), GetRand (std::numeric_limits<uint64_t >::max ()), *node.addrman , args.GetBoolArg (" -networkactive" , true ));
11721172
@@ -1276,7 +1276,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
12761276 asmap_path = DEFAULT_ASMAP_FILENAME;
12771277 }
12781278 if (!asmap_path.is_absolute ()) {
1279- asmap_path = GetDataDir () / asmap_path;
1279+ asmap_path = gArgs . GetDataDirNet () / asmap_path;
12801280 }
12811281 if (!fs::exists (asmap_path)) {
12821282 InitError (strprintf (_ (" Could not find asmap file %s" ), asmap_path));
@@ -1600,8 +1600,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
16001600
16011601 // ********************************************************* Step 11: import blocks
16021602
1603- if (!CheckDiskSpace (GetDataDir ())) {
1604- InitError (strprintf (_ (" Error: Disk space is low for %s" ), GetDataDir ()));
1603+ if (!CheckDiskSpace (gArgs . GetDataDirNet ())) {
1604+ InitError (strprintf (_ (" Error: Disk space is low for %s" ), gArgs . GetDataDirNet ()));
16051605 return false ;
16061606 }
16071607 if (!CheckDiskSpace (gArgs .GetBlocksDirPath ())) {
0 commit comments