feat(lite): add ObsidianDragonLite build mode and gate full-node features
Add --lite build flow and ObsidianDragonLite target naming, hide full-node pages/features in lite mode, enforce pool-only mining in lite, and include chat port feasibility audit documentation.
This commit is contained in:
@@ -151,6 +151,13 @@ static void RenderMiningTabContent(App* app)
|
||||
strncpy(s_pool_worker, app->settings()->getPoolWorker().c_str(), sizeof(s_pool_worker) - 1);
|
||||
s_pool_state_loaded = true;
|
||||
}
|
||||
#if DRAGONX_LITE_BUILD
|
||||
if (!s_pool_mode) {
|
||||
s_pool_mode = true;
|
||||
app->settings()->setPoolMode(true);
|
||||
app->settings()->save();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Default pool worker to user's first shielded (z) address once available.
|
||||
// For new wallets without a z-address, leave the field blank so the user
|
||||
@@ -235,10 +242,11 @@ static void RenderMiningTabContent(App* app)
|
||||
// MODE TOGGLE — SOLO | POOL segmented control
|
||||
// ================================================================
|
||||
{
|
||||
const bool liteBuild = app->isLiteBuild();
|
||||
float toggleW = schema::UI().drawElement("tabs.mining", "mode-toggle-width").size * hs;
|
||||
float toggleH = schema::UI().drawElement("tabs.mining", "mode-toggle-height").size;
|
||||
float toggleRnd = schema::UI().drawElement("tabs.mining", "mode-toggle-rounding").size;
|
||||
float totalW = toggleW * 2;
|
||||
float totalW = liteBuild ? toggleW : (toggleW * 2);
|
||||
|
||||
ImVec2 tMin = ImGui::GetCursorScreenPos();
|
||||
ImVec2 tMax(tMin.x + totalW, tMin.y + toggleH);
|
||||
@@ -247,16 +255,16 @@ static void RenderMiningTabContent(App* app)
|
||||
dl->AddRectFilled(tMin, tMax, WithAlpha(OnSurface(), 15), toggleRnd);
|
||||
dl->AddRect(tMin, tMax, WithAlpha(OnSurface(), 40), toggleRnd);
|
||||
|
||||
// SOLO button (left half)
|
||||
ImVec2 soloMin = tMin;
|
||||
ImVec2 soloMax(tMin.x + toggleW, tMax.y);
|
||||
bool soloHov = material::IsRectHovered(soloMin, soloMax);
|
||||
if (!s_pool_mode) {
|
||||
dl->AddRectFilled(soloMin, soloMax, WithAlpha(Primary(), 180), toggleRnd);
|
||||
} else if (soloHov) {
|
||||
dl->AddRectFilled(soloMin, soloMax, WithAlpha(OnSurface(), 20), toggleRnd);
|
||||
}
|
||||
{
|
||||
if (!liteBuild) {
|
||||
// SOLO button (left half)
|
||||
if (!s_pool_mode) {
|
||||
dl->AddRectFilled(soloMin, soloMax, WithAlpha(Primary(), 180), toggleRnd);
|
||||
} else if (soloHov) {
|
||||
dl->AddRectFilled(soloMin, soloMax, WithAlpha(OnSurface(), 20), toggleRnd);
|
||||
}
|
||||
const char* label = TR("mining_solo");
|
||||
ImVec2 sz = ovFont->CalcTextSizeA(ovFont->LegacySize, FLT_MAX, 0, label);
|
||||
float lx = soloMin.x + (toggleW - sz.x) * 0.5f;
|
||||
@@ -267,7 +275,7 @@ static void RenderMiningTabContent(App* app)
|
||||
|
||||
// POOL button (right half) — disabled when solo mining is active
|
||||
bool soloMiningActive = mining.generate;
|
||||
ImVec2 poolMin(tMin.x + toggleW, tMin.y);
|
||||
ImVec2 poolMin(tMin.x + (liteBuild ? 0.0f : toggleW), tMin.y);
|
||||
ImVec2 poolMax = tMax;
|
||||
bool poolHov = material::IsRectHovered(poolMin, poolMax);
|
||||
if (s_pool_mode) {
|
||||
@@ -288,19 +296,21 @@ static void RenderMiningTabContent(App* app)
|
||||
}
|
||||
|
||||
// Invisible buttons for click targets
|
||||
ImGui::SetCursorScreenPos(soloMin);
|
||||
ImGui::InvisibleButton("##SoloMode", ImVec2(toggleW, toggleH));
|
||||
if (ImGui::IsItemClicked() && s_pool_mode) {
|
||||
s_pool_mode = false;
|
||||
app->settings()->setPoolMode(false);
|
||||
app->settings()->save();
|
||||
app->stopPoolMining();
|
||||
if (!liteBuild) {
|
||||
ImGui::SetCursorScreenPos(soloMin);
|
||||
ImGui::InvisibleButton("##SoloMode", ImVec2(toggleW, toggleH));
|
||||
if (ImGui::IsItemClicked() && s_pool_mode) {
|
||||
s_pool_mode = false;
|
||||
app->settings()->setPoolMode(false);
|
||||
app->settings()->save();
|
||||
app->stopPoolMining();
|
||||
}
|
||||
if (soloHov) ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
|
||||
}
|
||||
if (soloHov) ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
|
||||
|
||||
ImGui::SetCursorScreenPos(poolMin);
|
||||
ImGui::InvisibleButton("##PoolMode", ImVec2(toggleW, toggleH));
|
||||
if (ImGui::IsItemClicked() && !s_pool_mode && !soloMiningActive) {
|
||||
if (!liteBuild && ImGui::IsItemClicked() && !s_pool_mode && !soloMiningActive) {
|
||||
s_pool_mode = true;
|
||||
app->settings()->setPoolMode(true);
|
||||
app->settings()->save();
|
||||
@@ -308,7 +318,7 @@ static void RenderMiningTabContent(App* app)
|
||||
// so no need to call stopMining() — it would just set the
|
||||
// toggle-in-progress flag and make the button show "STARTING".
|
||||
}
|
||||
if (poolHov && !soloMiningActive) ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
|
||||
if (!liteBuild && poolHov && !soloMiningActive) ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
|
||||
if (poolHov && soloMiningActive && !s_pool_mode) {
|
||||
ImGui::SetTooltip("%s", TR("mining_stop_solo_for_pool"));
|
||||
}
|
||||
@@ -1925,8 +1935,12 @@ static void RenderMiningTabContent(App* app)
|
||||
&& tx.memo.find("Mining Pool payout") != std::string::npos);
|
||||
if (isSoloMined || isPoolPayout) {
|
||||
// Apply earnings filter
|
||||
if (s_earnings_filter == 1 && !isSoloMined) continue;
|
||||
if (s_earnings_filter == 2 && !isPoolPayout) continue;
|
||||
if (app->isLiteBuild()) {
|
||||
if (s_earnings_filter == 1 && !isPoolPayout) continue;
|
||||
} else {
|
||||
if (s_earnings_filter == 1 && !isSoloMined) continue;
|
||||
if (s_earnings_filter == 2 && !isPoolPayout) continue;
|
||||
}
|
||||
|
||||
double amt = std::abs(tx.amount);
|
||||
minedAllTime += amt;
|
||||
@@ -1970,8 +1984,10 @@ static void RenderMiningTabContent(App* app)
|
||||
|
||||
// === Earnings filter toggle button (top-right of card) ===
|
||||
{
|
||||
const char* filterLabels[] = { TR("mining_filter_all"), TR("mining_solo"), TR("mining_pool") };
|
||||
const char* filterIcons[] = { ICON_MD_FUNCTIONS, ICON_MD_MEMORY, ICON_MD_CLOUD };
|
||||
const bool liteBuild = app->isLiteBuild();
|
||||
const char* filterLabels[] = { TR("mining_filter_all"), liteBuild ? TR("mining_pool") : TR("mining_solo"), TR("mining_pool") };
|
||||
const char* filterIcons[] = { ICON_MD_FUNCTIONS, liteBuild ? ICON_MD_CLOUD : ICON_MD_MEMORY, ICON_MD_CLOUD };
|
||||
const int filterCount = liteBuild ? 2 : 3;
|
||||
const char* curIcon = filterIcons[s_earnings_filter];
|
||||
const char* curLabel = filterLabels[s_earnings_filter];
|
||||
|
||||
@@ -2011,13 +2027,13 @@ static void RenderMiningTabContent(App* app)
|
||||
ImGui::SetCursorScreenPos(bMin);
|
||||
ImGui::InvisibleButton("##EarningsFilter", ImVec2(btnW, btnH));
|
||||
if (ImGui::IsItemClicked()) {
|
||||
s_earnings_filter = (s_earnings_filter + 1) % 3;
|
||||
s_earnings_filter = (s_earnings_filter + 1) % filterCount;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
|
||||
const char* tips[] = {
|
||||
TR("mining_filter_tip_all"),
|
||||
TR("mining_filter_tip_solo"),
|
||||
liteBuild ? TR("mining_filter_tip_pool") : TR("mining_filter_tip_solo"),
|
||||
TR("mining_filter_tip_pool")
|
||||
};
|
||||
ImGui::SetTooltip("%s", tips[s_earnings_filter]);
|
||||
|
||||
Reference in New Issue
Block a user