Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve net_listening implementation #13387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

crStiv
Copy link

@crStiv crStiv commented Jan 11, 2025

Replace hardcoded value with actual network state check.
The method now properly reflects network connectivity status by checking if the node can communicate with the network.

@crStiv
Copy link
Author

crStiv commented Jan 15, 2025

@mh0lt if everything is alright, can you merge it please?

func (api *NetAPIImpl) Listening(_ context.Context) (bool, error) {
func (api *NetAPIImpl) Listening(ctx context.Context) (bool, error) {
if api.ethBackend == nil {
// We're running in --datadir mode or otherwise cannot get the backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have RemoteBackend in this case: which has GRPC methods

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here:

remoteBackendClient := remote.NewETHBACKENDClient(conn)

@crStiv
Copy link
Author

crStiv commented Jan 15, 2025

@AskAlexSharov made some changs, what do you think abt them?

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.

3 participants