forked from TrueCloudLab/neoneo-go
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)
|
||||
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