refactor(walletapi): remove redundant test_connectivity from Notify_broadcaster#29
Open
moralpriest wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes
go test_connectivity()from the Height case in Notify_broadcasterNotes