fix(network): keep the status-bar peer count current on every tab

The peer count in the status bar is state_.peers.size(), refreshed only by
getpeerinfo — and the peers refresh interval was 0 (disabled) on every tab
except Peers. So the count never changed until you opened the Peers/Network
tab. Give peers a slow 20s cadence on all tabs (30s on Console); the Peers tab
keeps its fast 5s for the live list. During sync this is still overridden by
kSyncProfile (peers 0) so it can't contend with block download. Test updated to
the new intervals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-13 11:12:13 -05:00
parent 2e115aef39
commit c71c3c3378
2 changed files with 16 additions and 10 deletions

View File

@@ -757,7 +757,8 @@ void testRefreshScheduler()
RefreshScheduler scheduler;
scheduler.applyPage(dragonx::ui::NavPage::Overview);
EXPECT_NEAR(scheduler.intervals().core, 2.0, 0.0001);
EXPECT_NEAR(scheduler.intervals().peers, 0.0, 0.0001);
// Peers now polls on every tab (slow cadence) so the status-bar peer count stays current.
EXPECT_NEAR(scheduler.intervals().peers, 20.0, 0.0001);
scheduler.tick(1.99f);
EXPECT_FALSE(scheduler.isDue(Timer::Core));
@@ -779,7 +780,7 @@ void testRefreshScheduler()
EXPECT_NEAR(scheduler.intervals().core, 10.0, 0.0001);
EXPECT_NEAR(scheduler.intervals().transactions, 30.0, 0.0001);
EXPECT_NEAR(scheduler.intervals().addresses, 30.0, 0.0001);
EXPECT_NEAR(scheduler.intervals().peers, 0.0, 0.0001);
EXPECT_NEAR(scheduler.intervals().peers, 30.0, 0.0001);
EXPECT_FALSE(scheduler.isDue(Timer::Price));
scheduler.markDue(Timer::Price);