diff --git a/waddrmgr/manager.go b/waddrmgr/manager.go index 2035a89..85d034d 100644 --- a/waddrmgr/manager.go +++ b/waddrmgr/manager.go @@ -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 } diff --git a/waddrmgr/scoped_manager.go b/waddrmgr/scoped_manager.go index 0f6ee3a..b9acda3 100644 --- a/waddrmgr/scoped_manager.go +++ b/waddrmgr/scoped_manager.go @@ -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) } }