use SNAP_DATA environment when available
@@ -1135,6 +1135,11 @@ boost::filesystem::path GetDefaultDataDir()
return pathRet / "Denarius";
#else
// Unix
+ // Run in the SNAP_DATA dir if we are running inside a snap
+ char* pszSnap = getenv("SNAP_DATA");
+ if (pszSnap == NULL || strlen(pszSnap) == 0)
+ return fs::path(pszSnap);
+ else
return pathRet / ".denarius";
#endif
#endif
