Skip to content

Commit

Permalink
rpcdaemon: Fix net_listening (#13637)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamc1 authored Jan 31, 2025
1 parent 8227e4c commit a679982
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions turbo/jsonrpc/net_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,8 @@ func NewNetAPIImpl(eth rpchelper.ApiBackend) *NetAPIImpl {
}

// Listening implements net_listening. Returns true if client is actively listening for network connections.
// If we can get peers info, it means the network interface is up and listening
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
return false, fmt.Errorf(NotAvailableChainData, "net_listening")
}

// If we can get peers info, it means the network interface is up and listening
_, err := api.ethBackend.Peers(ctx)
if err != nil {
return false, nil
Expand Down

0 comments on commit a679982

Please sign in to comment.