Merge pull request #608 from wpaulino/manager-oncommit-lock
waddrmgr: use methods that do not hold the manager's lock
This commit is contained in:
commit
89ab2044f9
2 changed files with 9 additions and 1 deletions
|
@ -337,6 +337,14 @@ func (m *Manager) WatchOnly() bool {
|
|||
m.mtx.RLock()
|
||||
defer m.mtx.RUnlock()
|
||||
|
||||
return m.watchOnly()
|
||||
}
|
||||
|
||||
// watchOnly returns true if the root manager is in watch only mode, and false
|
||||
// otherwise.
|
||||
//
|
||||
// NOTE: This method requires the Manager's lock to be held.
|
||||
func (m *Manager) watchOnly() bool {
|
||||
return m.watchingOnly
|
||||
}
|
||||
|
||||
|
|
|
@ -842,7 +842,7 @@ func (s *ScopedKeyManager) nextAddresses(ns walletdb.ReadWriteBucket,
|
|||
// Add the new managed address to the list of addresses
|
||||
// that need their private keys derived when the
|
||||
// address manager is next unlocked.
|
||||
if s.rootManager.IsLocked() && !s.rootManager.WatchOnly() {
|
||||
if s.rootManager.isLocked() && !s.rootManager.watchOnly() {
|
||||
s.deriveOnUnlock = append(s.deriveOnUnlock, info)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue