mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
Merge 3127734208 into 6ec13e7e2b
This commit is contained in:
commit
5af3de3328
2 changed files with 4 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ func (self *personalApi) UnlockAccount(req *shared.Request) (interface{}, error)
|
||||||
return nil, shared.NewDecodeParamError(err.Error())
|
return nil, shared.NewDecodeParamError(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(args.Passphrase) == 0 {
|
if !args.HasPW {
|
||||||
fe := self.xeth.Frontend()
|
fe := self.xeth.Frontend()
|
||||||
if fe == nil {
|
if fe == nil {
|
||||||
return false, fmt.Errorf("No password provided")
|
return false, fmt.Errorf("No password provided")
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ func (args *NewAccountArgs) UnmarshalJSON(b []byte) (err error) {
|
||||||
type UnlockAccountArgs struct {
|
type UnlockAccountArgs struct {
|
||||||
Address string
|
Address string
|
||||||
Passphrase string
|
Passphrase string
|
||||||
|
HasPW bool
|
||||||
Duration int
|
Duration int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,6 +58,7 @@ func (args *UnlockAccountArgs) UnmarshalJSON(b []byte) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Duration = 0
|
args.Duration = 0
|
||||||
|
args.HasPW = false
|
||||||
|
|
||||||
if len(obj) < 1 {
|
if len(obj) < 1 {
|
||||||
return shared.NewInsufficientParamsError(len(obj), 1)
|
return shared.NewInsufficientParamsError(len(obj), 1)
|
||||||
|
|
@ -71,6 +73,7 @@ func (args *UnlockAccountArgs) UnmarshalJSON(b []byte) (err error) {
|
||||||
if len(obj) >= 2 && obj[1] != nil {
|
if len(obj) >= 2 && obj[1] != nil {
|
||||||
if passphrasestr, ok := obj[1].(string); ok {
|
if passphrasestr, ok := obj[1].(string); ok {
|
||||||
args.Passphrase = passphrasestr
|
args.Passphrase = passphrasestr
|
||||||
|
args.HasPW = true
|
||||||
} else {
|
} else {
|
||||||
return shared.NewInvalidTypeError("passphrase", "not a string")
|
return shared.NewInvalidTypeError("passphrase", "not a string")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue