|
@@ -32,7 +32,6 @@ import (
|
|
|
"github.com/ethereum/go-ethereum/crypto"
|
|
"github.com/ethereum/go-ethereum/crypto"
|
|
|
"github.com/ethereum/go-ethereum/eth"
|
|
"github.com/ethereum/go-ethereum/eth"
|
|
|
"github.com/ethereum/go-ethereum/logger/glog"
|
|
"github.com/ethereum/go-ethereum/logger/glog"
|
|
|
- "github.com/ethereum/go-ethereum/p2p"
|
|
|
|
|
"github.com/ethereum/go-ethereum/rlp"
|
|
"github.com/ethereum/go-ethereum/rlp"
|
|
|
"github.com/ethereum/go-ethereum/rpc/codec"
|
|
"github.com/ethereum/go-ethereum/rpc/codec"
|
|
|
"github.com/ethereum/go-ethereum/rpc/comms"
|
|
"github.com/ethereum/go-ethereum/rpc/comms"
|
|
@@ -81,17 +80,15 @@ type adminhandler func(*adminApi, *shared.Request) (interface{}, error)
|
|
|
// admin api provider
|
|
// admin api provider
|
|
|
type adminApi struct {
|
|
type adminApi struct {
|
|
|
xeth *xeth.XEth
|
|
xeth *xeth.XEth
|
|
|
- network *p2p.Server
|
|
|
|
|
ethereum *eth.Ethereum
|
|
ethereum *eth.Ethereum
|
|
|
codec codec.Codec
|
|
codec codec.Codec
|
|
|
coder codec.ApiCoder
|
|
coder codec.ApiCoder
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// create a new admin api instance
|
|
// create a new admin api instance
|
|
|
-func NewAdminApi(xeth *xeth.XEth, network *p2p.Server, ethereum *eth.Ethereum, codec codec.Codec) *adminApi {
|
|
|
|
|
|
|
+func NewAdminApi(xeth *xeth.XEth, ethereum *eth.Ethereum, codec codec.Codec) *adminApi {
|
|
|
return &adminApi{
|
|
return &adminApi{
|
|
|
xeth: xeth,
|
|
xeth: xeth,
|
|
|
- network: network,
|
|
|
|
|
ethereum: ethereum,
|
|
ethereum: ethereum,
|
|
|
codec: codec,
|
|
codec: codec,
|
|
|
coder: codec.New(nil),
|
|
coder: codec.New(nil),
|
|
@@ -140,11 +137,11 @@ func (self *adminApi) AddPeer(req *shared.Request) (interface{}, error) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (self *adminApi) Peers(req *shared.Request) (interface{}, error) {
|
|
func (self *adminApi) Peers(req *shared.Request) (interface{}, error) {
|
|
|
- return self.network.PeersInfo(), nil
|
|
|
|
|
|
|
+ return self.ethereum.Network().PeersInfo(), nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (self *adminApi) NodeInfo(req *shared.Request) (interface{}, error) {
|
|
func (self *adminApi) NodeInfo(req *shared.Request) (interface{}, error) {
|
|
|
- return self.network.NodeInfo(), nil
|
|
|
|
|
|
|
+ return self.ethereum.Network().NodeInfo(), nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (self *adminApi) DataDir(req *shared.Request) (interface{}, error) {
|
|
func (self *adminApi) DataDir(req *shared.Request) (interface{}, error) {
|