mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 09:50:45 +00:00
add option set account , password with flag
This commit is contained in:
parent
cb5a55a904
commit
7597e6ca5e
1 changed files with 8 additions and 0 deletions
|
|
@ -231,6 +231,14 @@ func startNode(ctx *cli.Context, stack *node.Node,cfg XDCConfig) {
|
||||||
|
|
||||||
//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