Skip to content

Commit

Permalink
internal/ethapi: add net_nodeInfo (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann authored Mar 21, 2024
1 parent 1208d07 commit e313d5b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,16 @@ func (s *NetAPI) Version() string {
return fmt.Sprintf("%d", s.networkVersion)
}

// NodeInfo retrieves all the information we know about the host node at the
// protocol granularity. This is the same as the `admin_nodeInfo` method.
func (s *NetAPI) NodeInfo() (*p2p.NodeInfo, error) {
server := s.net
if server == nil {
return nil, errors.New("server not found")
}
return s.net.NodeInfo(), nil
}

// checkTxFee is an internal function used to check whether the fee of
// the given transaction is _reasonable_(under the cap).
func checkTxFee(gasPrice *big.Int, gas uint64, cap float64) error {
Expand Down

0 comments on commit e313d5b

Please sign in to comment.