From 4b18bb6ea4db0e856935c2b6ac61235b64c9a915 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:41:05 +0100 Subject: [PATCH] Try to create the data dir if it doesn't exist --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index de00fee..a04941c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,7 @@ #include "stratum_server.h" #include "p2p_server.h" #include +#include #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); + } } }