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
37c1a8f6
Commit
37c1a8f6
authored
Jul 07, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth,miner,rpc: set coinbase
parent
35cd355c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletion
+13
-1
backend.go
eth/backend.go
+1
-0
miner.go
miner/miner.go
+5
-0
worker.go
miner/worker.go
+6
-0
miner.go
rpc/api/miner.go
+1
-1
No files found.
eth/backend.go
View file @
37c1a8f6
...
...
@@ -472,6 +472,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
// set in js console via admin interface or wrapper from cli flags
func
(
self
*
Ethereum
)
SetEtherbase
(
etherbase
common
.
Address
)
{
self
.
etherbase
=
etherbase
self
.
miner
.
SetEtherbase
(
etherbase
)
}
func
(
s
*
Ethereum
)
StopMining
()
{
s
.
miner
.
Stop
()
}
...
...
miner/miner.go
View file @
37c1a8f6
...
...
@@ -137,3 +137,8 @@ func (self *Miner) PendingState() *state.StateDB {
func
(
self
*
Miner
)
PendingBlock
()
*
types
.
Block
{
return
self
.
worker
.
pendingBlock
()
}
func
(
self
*
Miner
)
SetEtherbase
(
addr
common
.
Address
)
{
self
.
coinbase
=
addr
self
.
worker
.
setEtherbase
(
addr
)
}
miner/worker.go
View file @
37c1a8f6
...
...
@@ -124,6 +124,12 @@ func newWorker(coinbase common.Address, eth core.Backend) *worker {
return
worker
}
func
(
self
*
worker
)
setEtherbase
(
addr
common
.
Address
)
{
self
.
mu
.
Lock
()
defer
self
.
mu
.
Unlock
()
self
.
coinbase
=
addr
}
func
(
self
*
worker
)
pendingState
()
*
state
.
StateDB
{
self
.
currentMu
.
Lock
()
defer
self
.
currentMu
.
Unlock
()
...
...
rpc/api/miner.go
View file @
37c1a8f6
...
...
@@ -19,7 +19,7 @@ var (
"miner_makeDAG"
:
(
*
minerApi
)
.
MakeDAG
,
"miner_setExtra"
:
(
*
minerApi
)
.
SetExtra
,
"miner_setGasPrice"
:
(
*
minerApi
)
.
SetGasPrice
,
"
admin
_setEtherbase"
:
(
*
minerApi
)
.
SetEtherbase
,
"
miner
_setEtherbase"
:
(
*
minerApi
)
.
SetEtherbase
,
"miner_startAutoDAG"
:
(
*
minerApi
)
.
StartAutoDAG
,
"miner_start"
:
(
*
minerApi
)
.
StartMiner
,
"miner_stopAutoDAG"
:
(
*
minerApi
)
.
StopAutoDAG
,
...
...
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