mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
waddrmgr: return err when priv key is requested for watch-only addr
This commit is contained in:
parent
0b5eca1835
commit
283f914b95
1 changed files with 6 additions and 0 deletions
|
@ -151,6 +151,12 @@ func (a *managedAddress) unlock(key EncryptorDecryptor) ([]byte, error) {
|
||||||
a.privKeyMutex.Lock()
|
a.privKeyMutex.Lock()
|
||||||
defer a.privKeyMutex.Unlock()
|
defer a.privKeyMutex.Unlock()
|
||||||
|
|
||||||
|
// If the address belongs to a watch-only account, the encrypted private
|
||||||
|
// key won't be present, so we'll return an error.
|
||||||
|
if len(a.privKeyEncrypted) == 0 {
|
||||||
|
return nil, managerError(ErrWatchingOnly, errWatchingOnly, nil)
|
||||||
|
}
|
||||||
|
|
||||||
if len(a.privKeyCT) == 0 {
|
if len(a.privKeyCT) == 0 {
|
||||||
privKey, err := key.Decrypt(a.privKeyEncrypted)
|
privKey, err := key.Decrypt(a.privKeyEncrypted)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue