aboutsummaryrefslogtreecommitdiffstats
path: root/node/api.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-12-17 22:39:55 +0800
committerFelix Lange <fjl@twurst.com>2016-12-20 21:41:58 +0800
commitcf71f5cd604f4d5c94d9e9b12b121a614d662dc7 (patch)
treea89491c26dc19fc39bb6d8273eeefa2778ff5ec2 /node/api.go
parentadab2e16bdf24c2eaf498722187fb36c04a5376b (diff)
downloaddexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar.gz
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar.bz2
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar.lz
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar.xz
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.tar.zst
dexon-cf71f5cd604f4d5c94d9e9b12b121a614d662dc7.zip
rpc: remove HexNumber, replace all uses with hexutil types
This change couldn't be automated because HexNumber was used for numbers of all sizes.
Diffstat (limited to 'node/api.go')
-rw-r--r--node/api.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/node/api.go b/node/api.go
index 7c9ad601a..988eff379 100644
--- a/node/api.go
+++ b/node/api.go
@@ -25,7 +25,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
- "github.com/ethereum/go-ethereum/rpc"
"github.com/rcrowley/go-metrics"
)
@@ -75,7 +74,7 @@ func (api *PrivateAdminAPI) RemovePeer(url string) (bool, error) {
}
// StartRPC starts the HTTP RPC API server.
-func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *string, apis *string) (bool, error) {
+func (api *PrivateAdminAPI) StartRPC(host *string, port *int, cors *string, apis *string) (bool, error) {
api.node.lock.Lock()
defer api.node.lock.Unlock()
@@ -91,7 +90,7 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st
host = &h
}
if port == nil {
- port = rpc.NewHexNumber(api.node.config.HTTPPort)
+ port = &api.node.config.HTTPPort
}
if cors == nil {
cors = &api.node.config.HTTPCors
@@ -105,7 +104,7 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st
}
}
- if err := api.node.startHTTP(fmt.Sprintf("%s:%d", *host, port.Int()), api.node.rpcAPIs, modules, *cors); err != nil {
+ if err := api.node.startHTTP(fmt.Sprintf("%s:%d", *host, port), api.node.rpcAPIs, modules, *cors); err != nil {
return false, err
}
return true, nil
@@ -124,7 +123,7 @@ func (api *PrivateAdminAPI) StopRPC() (bool, error) {
}
// StartWS starts the websocket RPC API server.
-func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOrigins *string, apis *string) (bool, error) {
+func (api *PrivateAdminAPI) StartWS(host *string, port *int, allowedOrigins *string, apis *string) (bool, error) {
api.node.lock.Lock()
defer api.node.lock.Unlock()
@@ -140,7 +139,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr
host = &h
}
if port == nil {
- port = rpc.NewHexNumber(api.node.config.WSPort)
+ port = &api.node.config.WSPort
}
if allowedOrigins == nil {
allowedOrigins = &api.node.config.WSOrigins
@@ -154,7 +153,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr
}
}
- if err := api.node.startWS(fmt.Sprintf("%s:%d", *host, port.Int()), api.node.rpcAPIs, modules, *allowedOrigins); err != nil {
+ if err := api.node.startWS(fmt.Sprintf("%s:%d", *host, *port), api.node.rpcAPIs, modules, *allowedOrigins); err != nil {
return false, err
}
return true, nil