Review report

bitcoin-core/gui-qml: PR #981

1 suggestion

Optional improvements

Link

[suggestion] · Overlapping notifications can starve status publication

Notifications overlapping every status query can keep GUI peer counts and warnings stale until notifications pause, even when completed queries contain newer values.

Location: qml/models/nodemodel.cpp:308 (head).

Details and suggested fix

refreshStatus() captures status_generation before submitting work and publishes counts and warnings only if that generation still matches at GUI completion. Every connection-count, alert and network-active notification increments it. If at least one notification arrives during every submission-to-delivery window, each completed snapshot is discarded and immediately queried again, leaving the displayed values unchanged. This can discard a snapshot even when its worker reads occurred after the notification. Publish the count and warning results from every successful completion, then request a follow-up when the generation changed. Only one status query is in flight, and these fields are updated only by its completions, so this preserves their ordering. Keep a separate freshness check for snapshot.network_active, since notifications also update that property directly. The existing burst test stops notifications before releasing the blocked query and therefore does not cover sustained overlap. Notification rates and round-trip latency were not measured, so production frequency is unconfirmed; ordinary bursts can converge after an extra query.


Coverage details