Skip to content

refactor(walletapi): remove redundant test_connectivity from Notify_broadcaster#29

Open
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:refactor/walletapi-remove-redundant-connectivity-check
Open

refactor(walletapi): remove redundant test_connectivity from Notify_broadcaster#29
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:refactor/walletapi-remove-redundant-connectivity-check

Conversation

@moralpriest

Copy link
Copy Markdown

Remove the go test_connectivity() goroutine from the Notify_broadcaster function in the Height notification handler.

Problem

Notify_broadcaster received a goroutine that called test_connectivity() on every Height notification. This is redundant because:

  1. Receiving the notification itself already proves the daemon connection is alive
  2. The timer.Reset call at the top of the function already serves as the liveness signal
  3. test_connectivity makes additional RPC calls (Echo + GetInfo) that add overhead on every block

Changes

  • Remove go test_connectivity() from the Height case in Notify_broadcaster

Notes

  • The existing timer.Reset at line 102 handles liveness detection
  • Keep_Connectivity watchdog provides the actual dead-connection recovery
  • Reduces per-block RPC overhead by 2 calls (Echo + GetInfo)

…roadcaster

The Notify_broadcaster function received a goroutine that called
test_connectivity() on every Height notification. This is redundant
because receiving the notification itself already proves the daemon
connection is alive. The timer.Reset call at the top of the function
already serves as the liveness signal by keeping Keep_Connectivity
from issuing unnecessary ping checks.

Removing this goroutine reduces overhead on every block notification
and eliminates a potential race where test_connectivity could briefly
set Connected=false if the daemon is slow to respond to the Echo/GetInfo
calls that follow the Height notification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant