File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -906,7 +906,7 @@ bool AppInitParameterInteraction()
906906
907907 // also see: InitParameterInteraction()
908908
909- if (!fs::is_directory (GetBlocksDir (false ))) {
909+ if (!fs::is_directory (GetBlocksDir ())) {
910910 return InitError (strprintf (_ (" Specified blocks directory \" %s\" does not exist." ), gArgs .GetArg (" -blocksdir" , " " ).c_str ()));
911911 }
912912
Original file line number Diff line number Diff line change @@ -728,18 +728,17 @@ fs::path GetDefaultDataDir()
728728#endif
729729}
730730
731- static fs::path g_blocks_path_cached;
732731static fs::path g_blocks_path_cache_net_specific;
733732static fs::path pathCached;
734733static fs::path pathCachedNetSpecific;
735734static CCriticalSection csPathCached;
736735
737- const fs::path &GetBlocksDir (bool fNetSpecific )
736+ const fs::path &GetBlocksDir ()
738737{
739738
740739 LOCK (csPathCached);
741740
742- fs::path &path = fNetSpecific ? g_blocks_path_cache_net_specific : g_blocks_path_cached ;
741+ fs::path &path = g_blocks_path_cache_net_specific;
743742
744743 // This can be called during exceptions by LogPrintf(), so we cache the
745744 // value so we don't have to do memory allocations after that.
@@ -755,9 +754,8 @@ const fs::path &GetBlocksDir(bool fNetSpecific)
755754 } else {
756755 path = GetDataDir (false );
757756 }
758- if (fNetSpecific )
759- path /= BaseParams ().DataDir ();
760757
758+ path /= BaseParams ().DataDir ();
761759 path /= " blocks" ;
762760 fs::create_directories (path);
763761 return path;
@@ -801,7 +799,6 @@ void ClearDatadirCache()
801799
802800 pathCached = fs::path ();
803801 pathCachedNetSpecific = fs::path ();
804- g_blocks_path_cached = fs::path ();
805802 g_blocks_path_cache_net_specific = fs::path ();
806803}
807804
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ void ReleaseDirectoryLocks();
7878
7979bool TryCreateDirectories (const fs::path& p);
8080fs::path GetDefaultDataDir ();
81- const fs::path &GetBlocksDir (bool fNetSpecific = true );
81+ // The blocks directory is always net specific.
82+ const fs::path &GetBlocksDir ();
8283const fs::path &GetDataDir (bool fNetSpecific = true );
8384void ClearDatadirCache ();
8485fs::path GetConfigFile (const std::string& confPath);
You can’t perform that action at this time.
0 commit comments