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
41b83fe1
Commit
41b83fe1
authored
Apr 12, 2015
by
Kobi Gurkan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds eth_hashrate RPC method
parent
4ddbf81e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
backend.go
eth/backend.go
+1
-0
api.go
rpc/api.go
+2
-0
xeth.go
xeth/xeth.go
+4
-0
No files found.
eth/backend.go
View file @
41b83fe1
...
@@ -341,6 +341,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
...
@@ -341,6 +341,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
func
(
s
*
Ethereum
)
StopMining
()
{
s
.
miner
.
Stop
()
}
func
(
s
*
Ethereum
)
StopMining
()
{
s
.
miner
.
Stop
()
}
func
(
s
*
Ethereum
)
IsMining
()
bool
{
return
s
.
miner
.
Mining
()
}
func
(
s
*
Ethereum
)
IsMining
()
bool
{
return
s
.
miner
.
Mining
()
}
func
(
s
*
Ethereum
)
HashRate
()
int64
{
return
s
.
miner
.
HashRate
()
}
func
(
s
*
Ethereum
)
Miner
()
*
miner
.
Miner
{
return
s
.
miner
}
func
(
s
*
Ethereum
)
Miner
()
*
miner
.
Miner
{
return
s
.
miner
}
// func (s *Ethereum) Logger() logger.LogSystem { return s.logger }
// func (s *Ethereum) Logger() logger.LogSystem { return s.logger }
...
...
rpc/api.go
View file @
41b83fe1
...
@@ -62,6 +62,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -62,6 +62,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
*
reply
=
newHexData
(
api
.
xeth
()
.
Coinbase
())
*
reply
=
newHexData
(
api
.
xeth
()
.
Coinbase
())
case
"eth_mining"
:
case
"eth_mining"
:
*
reply
=
api
.
xeth
()
.
IsMining
()
*
reply
=
api
.
xeth
()
.
IsMining
()
case
"eth_hashrate"
:
*
reply
=
api
.
xeth
()
.
HashRate
()
case
"eth_gasPrice"
:
case
"eth_gasPrice"
:
v
:=
xeth
.
DefaultGas
()
v
:=
xeth
.
DefaultGas
()
*
reply
=
newHexData
(
v
.
Bytes
())
*
reply
=
newHexData
(
v
.
Bytes
())
...
...
xeth/xeth.go
View file @
41b83fe1
...
@@ -276,6 +276,10 @@ func (self *XEth) IsMining() bool {
...
@@ -276,6 +276,10 @@ func (self *XEth) IsMining() bool {
return
self
.
backend
.
IsMining
()
return
self
.
backend
.
IsMining
()
}
}
func
(
self
*
XEth
)
HashRate
()
int64
{
return
self
.
backend
.
HashRate
()
}
func
(
self
*
XEth
)
EthVersion
()
string
{
func
(
self
*
XEth
)
EthVersion
()
string
{
return
fmt
.
Sprintf
(
"%d"
,
self
.
backend
.
EthVersion
())
return
fmt
.
Sprintf
(
"%d"
,
self
.
backend
.
EthVersion
())
}
}
...
...
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