mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
lib/model: Remove unused func (#6456)
This commit is contained in:
parent
963e9a4071
commit
b7dffc051e
@ -2562,30 +2562,6 @@ func (m *model) checkFolderRunningLocked(folder string) error {
|
||||
return errFolderNotRunning
|
||||
}
|
||||
|
||||
// checkFolderDeviceStatusLocked first checks the folder and then whether the
|
||||
// given device is connected and shares this folder.
|
||||
// Need to hold (read) lock on both m.fmut and m.pmut when calling this.
|
||||
func (m *model) checkDeviceFolderConnectedLocked(device protocol.DeviceID, folder string) error {
|
||||
if err := m.checkFolderRunningLocked(folder); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg, ok := m.cfg.Device(device); !ok {
|
||||
return errDeviceUnknown
|
||||
} else if cfg.Paused {
|
||||
return errDevicePaused
|
||||
}
|
||||
|
||||
if _, ok := m.conn[device]; !ok {
|
||||
return errors.New("device is not connected")
|
||||
}
|
||||
|
||||
if cfg, ok := m.cfg.Folder(folder); !ok || !cfg.SharedWith(device) {
|
||||
return errors.New("folder is not shared with device")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// mapFolders returns a map of folder ID to folder configuration for the given
|
||||
// slice of folder configurations.
|
||||
func mapFolders(folders []config.FolderConfiguration) map[string]config.FolderConfiguration {
|
||||
|
Loading…
Reference in New Issue
Block a user