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()
906
906
907
907
// also see: InitParameterInteraction()
908
908
909
- if (!fs::is_directory (GetBlocksDir (false ))) {
909
+ if (!fs::is_directory (GetBlocksDir ())) {
910
910
return InitError (strprintf (_ (" Specified blocks directory \" %s\" does not exist." ), gArgs .GetArg (" -blocksdir" , " " ).c_str ()));
911
911
}
912
912
Original file line number Diff line number Diff line change @@ -728,18 +728,17 @@ fs::path GetDefaultDataDir()
728
728
#endif
729
729
}
730
730
731
- static fs::path g_blocks_path_cached;
732
731
static fs::path g_blocks_path_cache_net_specific;
733
732
static fs::path pathCached;
734
733
static fs::path pathCachedNetSpecific;
735
734
static CCriticalSection csPathCached;
736
735
737
- const fs::path &GetBlocksDir (bool fNetSpecific )
736
+ const fs::path &GetBlocksDir ()
738
737
{
739
738
740
739
LOCK (csPathCached);
741
740
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;
743
742
744
743
// This can be called during exceptions by LogPrintf(), so we cache the
745
744
// value so we don't have to do memory allocations after that.
@@ -755,9 +754,8 @@ const fs::path &GetBlocksDir(bool fNetSpecific)
755
754
} else {
756
755
path = GetDataDir (false );
757
756
}
758
- if (fNetSpecific )
759
- path /= BaseParams ().DataDir ();
760
757
758
+ path /= BaseParams ().DataDir ();
761
759
path /= " blocks" ;
762
760
fs::create_directories (path);
763
761
return path;
@@ -801,7 +799,6 @@ void ClearDatadirCache()
801
799
802
800
pathCached = fs::path ();
803
801
pathCachedNetSpecific = fs::path ();
804
- g_blocks_path_cached = fs::path ();
805
802
g_blocks_path_cache_net_specific = fs::path ();
806
803
}
807
804
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ void ReleaseDirectoryLocks();
78
78
79
79
bool TryCreateDirectories (const fs::path& p);
80
80
fs::path GetDefaultDataDir ();
81
- const fs::path &GetBlocksDir (bool fNetSpecific = true );
81
+ // The blocks directory is always net specific.
82
+ const fs::path &GetBlocksDir ();
82
83
const fs::path &GetDataDir (bool fNetSpecific = true );
83
84
void ClearDatadirCache ();
84
85
fs::path GetConfigFile (const std::string& confPath);
You can’t perform that action at this time.
0 commit comments