mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
add option set account , password with flag
This commit is contained in:
parent
564641a1ad
commit
a3773b4b42
1 changed files with 8 additions and 0 deletions
|
|
@ -231,6 +231,14 @@ func startNode(ctx *cli.Context, stack *node.Node,cfg tomoConfig) {
|
||||||
|
|
||||||
//passwords := utils.MakePasswordList(ctx)
|
//passwords := utils.MakePasswordList(ctx)
|
||||||
//unlocks := strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",")
|
//unlocks := strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",")
|
||||||
|
if(ctx.GlobalIsSet(utils.UnlockedAccountFlag.Name)) {
|
||||||
|
cfg.Account.Unlocks=strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",")
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ctx.GlobalIsSet(utils.PasswordFileFlag.Name)) {
|
||||||
|
cfg.Account.Passwords=utils.MakePasswordList(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
for i, account := range cfg.Account.Unlocks {
|
for i, account := range cfg.Account.Unlocks {
|
||||||
if trimmed := strings.TrimSpace(account); trimmed != "" {
|
if trimmed := strings.TrimSpace(account); trimmed != "" {
|
||||||
unlockAccount(ctx, ks, trimmed, i, cfg.Account.Passwords)
|
unlockAccount(ctx, ks, trimmed, i, cfg.Account.Passwords)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue