mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 19:29:39 +00:00
wallet: set WIF and public key on account decrypt
They are set during account creation and open+decrypt is expected to put account in the same state.
This commit is contained in:
parent
d837eb3761
commit
ad6fa2aea9
1 changed files with 8 additions and 1 deletions
|
@ -122,7 +122,14 @@ func (a *Account) Decrypt(passphrase string) error {
|
|||
return errors.New("no encrypted wif in the account")
|
||||
}
|
||||
a.privateKey, err = keys.NEP2Decrypt(a.EncryptedWIF, passphrase)
|
||||
return err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
a.publicKey = a.privateKey.PublicKey().Bytes()
|
||||
a.wif = a.privateKey.WIF()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Encrypt encrypts the wallet's PrivateKey with the given passphrase
|
||||
|
|
Loading…
Reference in a new issue