good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
af8ada45
Commit
af8ada45
authored
May 19, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Allow unlocking multiple accounts #1045
Separate accounts with spaces when using --unlock
parent
46d6470c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/geth/main.go
+13
-9
13 additions, 9 deletions
cmd/geth/main.go
with
13 additions
and
9 deletions
cmd/geth/main.go
+
13
−
9
View file @
af8ada45
...
@@ -364,11 +364,12 @@ func execJSFiles(ctx *cli.Context) {
...
@@ -364,11 +364,12 @@ func execJSFiles(ctx *cli.Context) {
func
unlockAccount
(
ctx
*
cli
.
Context
,
am
*
accounts
.
Manager
,
account
string
)
(
passphrase
string
)
{
func
unlockAccount
(
ctx
*
cli
.
Context
,
am
*
accounts
.
Manager
,
account
string
)
(
passphrase
string
)
{
var
err
error
var
err
error
// Load startup keys. XXX we are going to need a different format
// Load startup keys. XXX we are going to need a different format
// Attempt to unlock the account
passphrase
=
getPassPhrase
(
ctx
,
""
,
false
)
if
len
(
account
)
==
0
{
if
len
(
account
)
==
0
{
utils
.
Fatalf
(
"Invalid account address '%s'"
,
account
)
utils
.
Fatalf
(
"Invalid account address '%s'"
,
account
)
}
}
// Attempt to unlock the account
passphrase
=
getPassPhrase
(
ctx
,
"Unlocking account "
+
account
,
false
)
err
=
am
.
Unlock
(
common
.
HexToAddress
(
account
),
passphrase
)
err
=
am
.
Unlock
(
common
.
HexToAddress
(
account
),
passphrase
)
if
err
!=
nil
{
if
err
!=
nil
{
utils
.
Fatalf
(
"Unlock account failed '%v'"
,
err
)
utils
.
Fatalf
(
"Unlock account failed '%v'"
,
err
)
...
@@ -384,6 +385,8 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
...
@@ -384,6 +385,8 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
am
:=
eth
.
AccountManager
()
am
:=
eth
.
AccountManager
()
account
:=
ctx
.
GlobalString
(
utils
.
UnlockedAccountFlag
.
Name
)
account
:=
ctx
.
GlobalString
(
utils
.
UnlockedAccountFlag
.
Name
)
accounts
:=
strings
.
Split
(
account
,
" "
)
for
_
,
account
:=
range
accounts
{
if
len
(
account
)
>
0
{
if
len
(
account
)
>
0
{
if
account
==
"primary"
{
if
account
==
"primary"
{
primaryAcc
,
err
:=
am
.
Primary
()
primaryAcc
,
err
:=
am
.
Primary
()
...
@@ -394,6 +397,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
...
@@ -394,6 +397,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
}
}
unlockAccount
(
ctx
,
am
,
account
)
unlockAccount
(
ctx
,
am
,
account
)
}
}
}
// Start auxiliary services if enabled.
// Start auxiliary services if enabled.
if
ctx
.
GlobalBool
(
utils
.
RPCEnabledFlag
.
Name
)
{
if
ctx
.
GlobalBool
(
utils
.
RPCEnabledFlag
.
Name
)
{
if
err
:=
utils
.
StartRPC
(
eth
,
ctx
);
err
!=
nil
{
if
err
:=
utils
.
StartRPC
(
eth
,
ctx
);
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment