Skip to content

Commit 6b78d15

Browse files
chopperbrianoclaude
andcommitted
Dashboard: stop misreporting PSP registration (win.17)
The old PSP Pool status line was checking /keepalive with a fake address=test&peerId=test body and reporting "server not accepting new registrations" whenever it saw the "unsubscribe failed will time out anyways" response. That response is returned on EVERY keepalive, including successful ones that Linux nodes use to get paid, so the dashboard was lying to users. Replace the fake-keepalive check with an honest map.json lookup: - If map.json returns and contains our psp0payout address → "this node is listed" (server sees us as active) - If map.json returns but our payout isn't in it → "this node not yet listed" (newly subscribed or still propagating) - If map.json unreachable → "Pool unreachable" Also drop the misleading "unsubscribe failed" branch entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5832aef commit 6b78d15

2 files changed

Lines changed: 21 additions & 16 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SET(PATCH_VERSION 0)
4040
SET(SO_VERSION 0)
4141

4242
# Windows port build number (increment for each Windows-specific release)
43-
SET(WIN_BUILD 16)
43+
SET(WIN_BUILD 17)
4444

4545
# Add source directory
4646
include_directories(src)

src/ConsoleDashboard.cpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,12 @@ void ConsoleDashboard::render() {
493493
void ConsoleDashboard::checkPspRegistration() {
494494
auto now = std::chrono::steady_clock::now();
495495

496-
// Check pool reachability via map.json (public, no auth needed)
496+
// Check pool reachability via map.json (public, no auth needed).
497+
// map.json is the authoritative list of nodes the server has recently
498+
// seen alive, so its contents are the only honest signal for "am I
499+
// registered". The /keepalive endpoint ALWAYS returns
500+
// {"error":"unsubscribe failed will time out anyways"} regardless of
501+
// success — don't use it as a registration signal.
497502
try {
498503
std::string mapResponse = CurlHandler::get("https://ipfs.digiassetx.com/map.json", 5000);
499504
int nodeCount = 0;
@@ -504,22 +509,22 @@ void ConsoleDashboard::checkPspRegistration() {
504509
}
505510
_pspNodeCount = nodeCount;
506511

507-
// Test the keepalive endpoint to detect the "unsubscribe failed" error
508-
// which indicates the server isn't actually accepting registrations
512+
// Check if our own payout address appears anywhere in map.json —
513+
// that's a strong signal the server sees us as an active contributor.
514+
// (Peer ID matching would be better but map.json keys by payout.)
515+
bool selfListed = false;
509516
try {
510-
std::string kaResponse = CurlHandler::post(
511-
"https://ipfs.digiassetx.com/keepalive",
512-
{{"address", "test"}, {"peerId", "test"}, {"visible", "v"}, {"secret", "12345678"}},
513-
5000);
514-
if (kaResponse.find("unsubscribe failed") != std::string::npos) {
515-
_pspStatus = "Pool reachable - server not accepting new registrations";
516-
} else if (kaResponse.find("error") != std::string::npos) {
517-
_pspStatus = "Pool reachable - keepalive returns error";
518-
} else {
519-
_pspStatus = "Pool reachable - keepalive OK";
517+
Config config("config.cfg");
518+
std::string payout = config.getString("psp0payout", "");
519+
if (!payout.empty() && mapResponse.find(payout) != std::string::npos) {
520+
selfListed = true;
520521
}
521-
} catch (...) {
522-
_pspStatus = "Pool reachable - keepalive failed";
522+
} catch (...) {}
523+
524+
if (selfListed) {
525+
_pspStatus = "Pool reachable - this node is listed";
526+
} else {
527+
_pspStatus = "Pool reachable - this node not yet listed";
523528
}
524529
_lastPspCheck = now; // cache for 10 min
525530
} catch (...) {

0 commit comments

Comments
 (0)