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
1356daad
Commit
1356daad
authored
Jul 27, 2015
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
etherbase defaults to first account even if created during the session
parent
d18d2564
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
js_test.go
cmd/geth/js_test.go
+2
-1
backend.go
eth/backend.go
+5
-1
No files found.
cmd/geth/js_test.go
View file @
1356daad
...
@@ -159,7 +159,7 @@ func TestAccounts(t *testing.T) {
...
@@ -159,7 +159,7 @@ func TestAccounts(t *testing.T) {
defer
os
.
RemoveAll
(
tmp
)
defer
os
.
RemoveAll
(
tmp
)
checkEvalJSON
(
t
,
repl
,
`eth.accounts`
,
`["`
+
testAddress
+
`"]`
)
checkEvalJSON
(
t
,
repl
,
`eth.accounts`
,
`["`
+
testAddress
+
`"]`
)
checkEvalJSON
(
t
,
repl
,
`eth.coinbase`
,
`
null
`
)
checkEvalJSON
(
t
,
repl
,
`eth.coinbase`
,
`
"`
+
testAddress
+
`"
`
)
val
,
err
:=
repl
.
re
.
Run
(
`personal.newAccount("password")`
)
val
,
err
:=
repl
.
re
.
Run
(
`personal.newAccount("password")`
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"expected no error, got %v"
,
err
)
t
.
Errorf
(
"expected no error, got %v"
,
err
)
...
@@ -170,6 +170,7 @@ func TestAccounts(t *testing.T) {
...
@@ -170,6 +170,7 @@ func TestAccounts(t *testing.T) {
}
}
checkEvalJSON
(
t
,
repl
,
`eth.accounts`
,
`["`
+
testAddress
+
`","`
+
addr
+
`"]`
)
checkEvalJSON
(
t
,
repl
,
`eth.accounts`
,
`["`
+
testAddress
+
`","`
+
addr
+
`"]`
)
}
}
func
TestBlockChain
(
t
*
testing
.
T
)
{
func
TestBlockChain
(
t
*
testing
.
T
)
{
...
...
eth/backend.go
View file @
1356daad
...
@@ -489,7 +489,11 @@ func (s *Ethereum) StartMining(threads int) error {
...
@@ -489,7 +489,11 @@ func (s *Ethereum) StartMining(threads int) error {
func
(
s
*
Ethereum
)
Etherbase
()
(
eb
common
.
Address
,
err
error
)
{
func
(
s
*
Ethereum
)
Etherbase
()
(
eb
common
.
Address
,
err
error
)
{
eb
=
s
.
etherbase
eb
=
s
.
etherbase
if
(
eb
==
common
.
Address
{})
{
if
(
eb
==
common
.
Address
{})
{
err
=
fmt
.
Errorf
(
"etherbase address must be explicitly specified"
)
addr
,
e
:=
s
.
AccountManager
()
.
AddressByIndex
(
0
)
if
e
!=
nil
{
err
=
fmt
.
Errorf
(
"etherbase address must be explicitly specified"
)
}
eb
=
common
.
HexToAddress
(
addr
)
}
}
return
return
}
}
...
...
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