@@ -1367,7 +1367,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
13671367static bool LockDataDirectory (bool probeOnly)
13681368{
13691369 // Make sure only a single Dash Core process is using the data directory.
1370- fs::path datadir = GetDataDir ();
1370+ fs::path datadir = gArgs . GetDataDirNet ();
13711371 if (!DirIsWritable (datadir)) {
13721372 return InitError (strprintf (_ (" Cannot write to data directory '%s'; check permissions." ), datadir.string ()));
13731373 }
@@ -1531,7 +1531,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15311531 asmap_path = DEFAULT_ASMAP_FILENAME;
15321532 }
15331533 if (!asmap_path.is_absolute ()) {
1534- asmap_path = GetDataDir () / asmap_path;
1534+ asmap_path = gArgs . GetDataDirNet () / asmap_path;
15351535 }
15361536 if (!fs::exists (asmap_path)) {
15371537 InitError (strprintf (_ (" Could not find asmap file %s" ), asmap_path));
@@ -1555,7 +1555,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15551555 }
15561556
15571557 assert (!node.banman );
1558- node.banman = std::make_unique<BanMan>(GetDataDir () / " banlist" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
1558+ node.banman = std::make_unique<BanMan>(gArgs . GetDataDirNet () / " banlist" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
15591559 assert (!node.connman );
15601560 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 ));
15611561
@@ -1773,7 +1773,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
17731773 // ********************************************************* Step 7a: Load sporks
17741774
17751775 if (!node.sporkman ->LoadCache ()) {
1776- auto file_path = (GetDataDir () / " sporks.dat" ).string ();
1776+ auto file_path = (gArgs . GetDataDirNet () / " sporks.dat" ).string ();
17771777 return InitError (strprintf (_ (" Failed to load sporks cache from %s" ), file_path));
17781778 }
17791779
@@ -2128,15 +2128,15 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
21282128 bool fLoadCacheFiles = !(fReindex || fReindexChainState ) && (chainman.ActiveChain ().Tip () != nullptr );
21292129
21302130 if (!node.netfulfilledman ->LoadCache (fLoadCacheFiles )) {
2131- auto file_path = (GetDataDir () / " netfulfilled.dat" ).string ();
2131+ auto file_path = (gArgs . GetDataDirNet () / " netfulfilled.dat" ).string ();
21322132 if (fLoadCacheFiles ) {
21332133 return InitError (strprintf (_ (" Failed to load fulfilled requests cache from %s" ), file_path));
21342134 }
21352135 return InitError (strprintf (_ (" Failed to clear fulfilled requests cache at %s" ), file_path));
21362136 }
21372137
21382138 if (!node.mn_metaman ->LoadCache (fLoadCacheFiles )) {
2139- auto file_path = (GetDataDir () / " mncache.dat" ).string ();
2139+ auto file_path = (gArgs . GetDataDirNet () / " mncache.dat" ).string ();
21402140 if (fLoadCacheFiles ) {
21412141 return InitError (strprintf (_ (" Failed to load masternode cache from %s" ), file_path));
21422142 }
@@ -2145,7 +2145,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
21452145
21462146 if (is_governance_enabled) {
21472147 if (!node.govman ->LoadCache (fLoadCacheFiles )) {
2148- auto file_path = (GetDataDir () / " governance.dat" ).string ();
2148+ auto file_path = (gArgs . GetDataDirNet () / " governance.dat" ).string ();
21492149 if (fLoadCacheFiles ) {
21502150 return InitError (strprintf (_ (" Failed to load governance cache from %s" ), file_path));
21512151 }
@@ -2242,8 +2242,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
22422242
22432243 // ********************************************************* Step 11: import blocks
22442244
2245- if (!CheckDiskSpace (GetDataDir ())) {
2246- InitError (strprintf (_ (" Error: Disk space is low for %s" ), GetDataDir ()));
2245+ if (!CheckDiskSpace (gArgs . GetDataDirNet ())) {
2246+ InitError (strprintf (_ (" Error: Disk space is low for %s" ), gArgs . GetDataDirNet ()));
22472247 return false ;
22482248 }
22492249 if (!CheckDiskSpace (gArgs .GetBlocksDirPath ())) {
0 commit comments