Merge pull request #773 from guggero/account-info-lock-fix

waddrmgr: fix concurrent map access
This commit is contained in:
Olaoluwa Osuntokun 2021-10-22 15:20:26 -07:00 committed by GitHub
commit 9043c19d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -518,8 +518,8 @@ func (s *ScopedKeyManager) loadAccountInfo(ns walletdb.ReadBucket,
func (s *ScopedKeyManager) AccountProperties(ns walletdb.ReadBucket,
account uint32) (*AccountProperties, error) {
defer s.mtx.RUnlock()
s.mtx.RLock()
s.mtx.Lock()
defer s.mtx.Unlock()
props := &AccountProperties{
AccountNumber: account,