From c291e8a5870ffff215da2a40028dbd605664d9a0 Mon Sep 17 00:00:00 2001 From: DanS Date: Thu, 16 Jul 2026 19:08:41 -0500 Subject: [PATCH] fix(app): use #if not #ifdef for the per-variant instance lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DRAGONX_LITE_BUILD is ALWAYS defined (0 for the full node, 1 for Lite) via $, so the previous #ifdef was true for BOTH variants — the full node took the Lite branch and grabbed the "obsidiandragonlite" lock, so launching Lite next still collided ("ObsidianDragonLite already running"). Switch to #if DRAGONX_LITE_BUILD (value check), matching how the rest of the codebase guards this macro. Verified: full-node binary now contains only "obsidiandragon"; preprocessor check confirms LITE=1 selects "obsidiandragonlite". (wallet_capabilities.h's #ifndef is a separate, correct default-definition idiom — not affected.) Co-Authored-By: Claude Opus 4.8 (1M context) --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 961cb2b..31a404a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -441,7 +441,10 @@ static void Shutdown(SDL_Window* window, SDL_GLContext gl_context); // Global single instance lock. Keyed PER VARIANT so the full node and Lite can run side by side — // their config dirs are already separate (DRAGONX_APP_NAME), so only this lock kept them apart. -#ifdef DRAGONX_LITE_BUILD +// NB: DRAGONX_LITE_BUILD is ALWAYS defined (0 for the full node, 1 for Lite) via $, so this +// must be #if (value), not #ifdef (existence) — #ifdef is true for both and made the full node grab +// the Lite lock. +#if DRAGONX_LITE_BUILD static dragonx::util::SingleInstance g_single_instance("obsidiandragonlite"); #else static dragonx::util::SingleInstance g_single_instance("obsidiandragon");