diff --git a/waddrmgr/address.go b/waddrmgr/address.go index 45df8e0..a162308 100644 --- a/waddrmgr/address.go +++ b/waddrmgr/address.go @@ -508,7 +508,7 @@ type scriptAddress struct { account uint32 address *btcutil.AddressScriptHash scriptEncrypted []byte - scriptCT []byte + scriptClearText []byte scriptMutex sync.Mutex } @@ -524,7 +524,7 @@ func (a *scriptAddress) unlock(key EncryptorDecryptor) ([]byte, error) { a.scriptMutex.Lock() defer a.scriptMutex.Unlock() - if len(a.scriptCT) == 0 { + if len(a.scriptClearText) == 0 { script, err := key.Decrypt(a.scriptEncrypted) if err != nil { str := fmt.Sprintf("failed to decrypt script for %s", @@ -532,20 +532,20 @@ func (a *scriptAddress) unlock(key EncryptorDecryptor) ([]byte, error) { return nil, managerError(ErrCrypto, str, err) } - a.scriptCT = script + a.scriptClearText = script } - scriptCopy := make([]byte, len(a.scriptCT)) - copy(scriptCopy, a.scriptCT) + scriptCopy := make([]byte, len(a.scriptClearText)) + copy(scriptCopy, a.scriptClearText) return scriptCopy, nil } -// lock zeroes the associated clear text private key. +// lock zeroes the associated clear text script. func (a *scriptAddress) lock() { // Zero and nil the clear text script associated with this address. a.scriptMutex.Lock() - zero.Bytes(a.scriptCT) - a.scriptCT = nil + zero.Bytes(a.scriptClearText) + a.scriptClearText = nil a.scriptMutex.Unlock() } diff --git a/waddrmgr/scoped_manager.go b/waddrmgr/scoped_manager.go index db188d9..897b4de 100644 --- a/waddrmgr/scoped_manager.go +++ b/waddrmgr/scoped_manager.go @@ -2114,8 +2114,8 @@ func (s *ScopedKeyManager) ImportScript(ns walletdb.ReadWriteBucket, return nil, err } if !s.rootManager.WatchOnly() { - scriptAddr.scriptCT = make([]byte, len(script)) - copy(scriptAddr.scriptCT, script) + scriptAddr.scriptClearText = make([]byte, len(script)) + copy(scriptAddr.scriptClearText, script) } // Add the new managed address to the cache of recent addresses and