Try to create the data dir if it doesn't exist

This commit is contained in:
SChernykh
2024-12-04 19:41:05 +01:00
parent 921611ff4d
commit 4b18bb6ea4

View File

@@ -21,6 +21,7 @@
#include "stratum_server.h"
#include "p2p_server.h"
#include <curl/curl.h>
#include <filesystem>
#ifdef WITH_RANDOMX
#include "randomx.h"
@@ -208,6 +209,12 @@ int main(int argc, char* argv[])
}
p2pool::DATA_DIR = std::move(path);
// Try to create it if it doesn't exist
if (!p2pool::DATA_DIR.empty()) {
std::error_code err;
std::filesystem::create_directories(p2pool::DATA_DIR, err);
}
}
}