Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
6e534988
Commit
6e534988
authored
Nov 06, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpc/api: fix #1972 api regression (nil eth panic) in attach
parent
6d09468c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
admin.go
rpc/api/admin.go
+3
-6
utils.go
rpc/api/utils.go
+1
-1
No files found.
rpc/api/admin.go
View file @
6e534988
...
...
@@ -32,7 +32,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
...
...
@@ -81,17 +80,15 @@ type adminhandler func(*adminApi, *shared.Request) (interface{}, error)
// admin api provider
type
adminApi
struct
{
xeth
*
xeth
.
XEth
network
*
p2p
.
Server
ethereum
*
eth
.
Ethereum
codec
codec
.
Codec
coder
codec
.
ApiCoder
}
// 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
{
xeth
:
xeth
,
network
:
network
,
ethereum
:
ethereum
,
codec
:
codec
,
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
)
{
return
self
.
network
.
PeersInfo
(),
nil
return
self
.
ethereum
.
Network
()
.
PeersInfo
(),
nil
}
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
)
{
...
...
rpc/api/utils.go
View file @
6e534988
...
...
@@ -165,7 +165,7 @@ func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.
for
i
,
name
:=
range
names
{
switch
strings
.
ToLower
(
strings
.
TrimSpace
(
name
))
{
case
shared
.
AdminApiName
:
apis
[
i
]
=
NewAdminApi
(
xeth
,
eth
.
Network
(),
eth
,
codec
)
apis
[
i
]
=
NewAdminApi
(
xeth
,
eth
,
codec
)
case
shared
.
DebugApiName
:
apis
[
i
]
=
NewDebugApi
(
xeth
,
eth
,
codec
)
case
shared
.
DbApiName
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment