Skip to content

Commit 13ac8ad

Browse files
committed
Fix V36 transition banner not showing on dashboard
rest_version_signaling() was missing the auto_ratchet field that the dashboard JS checks to display the upper banner. Derive the effective ratchet state from chain data (matching p2pool web.py).
1 parent c229237 commit 13ac8ad

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/core/web_server.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5551,6 +5551,29 @@ nlohmann::json MiningInterface::rest_version_signaling(const nlohmann::json* cac
55515551
result["address_warnings"] = warnings;
55525552
}
55535553

5554+
// ── AutoRatchet effective state (matches p2pool web.py:382-391) ──
5555+
// c2pool has no live AutoRatchet object, so derive state from chain data.
5556+
// p2pool: confirmed = chain_height >= chain_length*3 AND 100% v36 shares
5557+
// activated = sampling >= 95%
5558+
// voting = otherwise (transition in progress)
5559+
{
5560+
std::string effective_state;
5561+
if (confirmed) {
5562+
effective_state = "confirmed";
5563+
} else if (sampling_signaling >= 95) {
5564+
effective_state = "activated";
5565+
} else {
5566+
effective_state = "voting";
5567+
}
5568+
result["auto_ratchet"] = {
5569+
{"state", effective_state},
5570+
{"persisted_state", effective_state},
5571+
{"activated_at", nullptr},
5572+
{"activated_height", nullptr},
5573+
{"confirmed_at", nullptr}
5574+
};
5575+
}
5576+
55545577
return result;
55555578
}
55565579

0 commit comments

Comments
 (0)