utils.Fatalf("Failed to read passphrase confirmation: %v",err)
}
ifpassword!=confirm{
utils.Fatalf("Passphrases do not match")
}
}
returnpassword
}
// accountCreate creates a new account into the keystore defined by the CLI flags.
funcaccountCreate(ctx*cli.Context){
accman:=utils.MakeAccountManager(ctx)
password:=getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.",true,0,utils.MakePasswordList(ctx))
account,err:=accman.NewAccount(password)
iferr!=nil{
utils.Fatalf("Failed to create account: %v",err)
}
fmt.Printf("Address: %x\n",account)
}
// accountUpdate transitions an account from a previous format to the current
// one, also providing the possibility to change the pass-phrase.
utils.Fatalf("Could not create the account: %v",err)
}
fmt.Printf("Address: %x\n",acct)
}
funcaccountImport(ctx*cli.Context){
keyfile:=ctx.Args().First()
iflen(keyfile)==0{
utils.Fatalf("keyfile must be given as argument")
}
accman:=utils.MakeAccountManager(ctx)
passphrase:=getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.",true,0,utils.MakePasswordList(ctx))
acct,err:=accman.Import(keyfile,passphrase)
iferr!=nil{
utils.Fatalf("Could not create the account: %v",err)
utils.Fatalf("Failed to read passphrase confirmation: %v",err)
}
ifpassword!=confirm{
utils.Fatalf("Passphrases do not match")
}
}
returnpassword
}
// accountCreate creates a new account into the keystore defined by the CLI flags.
funcaccountCreate(ctx*cli.Context){
accman:=utils.MakeAccountManager(ctx)
password:=getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.",true,0,utils.MakePasswordList(ctx))
account,err:=accman.NewAccount(password)
iferr!=nil{
utils.Fatalf("Failed to create account: %v",err)
}
fmt.Printf("Address: %x\n",account)
}
// accountUpdate transitions an account from a previous format to the current
// one, also providing the possibility to change the pass-phrase.
utils.Fatalf("Could not create the account: %v",err)
}
fmt.Printf("Address: %x\n",acct)
}
funcaccountImport(ctx*cli.Context){
keyfile:=ctx.Args().First()
iflen(keyfile)==0{
utils.Fatalf("keyfile must be given as argument")
}
accman:=utils.MakeAccountManager(ctx)
passphrase:=getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.",true,0,utils.MakePasswordList(ctx))
acct,err:=accman.Import(keyfile,passphrase)
iferr!=nil{
utils.Fatalf("Could not create the account: %v",err)