diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-22 14:08:36 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-22 14:08:36 -0400 |
commit | 3eb522469e641e31d02fa060a1b48b93edbf7d84 (patch) | |
tree | 5d107b396c60822cf16f919e806d3fa9d042beb0 /Storage.hs | |
parent | fc143a225540c49a0d7f4b9e1bb0345a89260ea5 (diff) | |
download | keysafe-3eb522469e641e31d02fa060a1b48b93edbf7d84.tar.gz |
record already-existing backup in log after restoring a secret key
This will prevent --autostart from prompting to get the newly restored key
backed up again.
This commit was sponsored by Remy van Elst on Patreon.
Diffstat (limited to 'Storage.hs')
-rw-r--r-- | Storage.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -90,13 +90,14 @@ storeShares (StorageLocations locs) allsis shares updateprogress = do -- Assumes that each location only contains one share. So, once a -- share has been found on a location, can avoid asking that location -- for any other shares. -retrieveShares :: StorageLocations -> ShareIdents -> UpdateProgress -> IO (S.Set Share, ShareIdents) +retrieveShares :: StorageLocations -> ShareIdents -> UpdateProgress -> IO (S.Set Share, ShareIdents, [Server]) retrieveShares (StorageLocations locs) sis updateprogress = do let (is, sis') = nextShareIdents sis let want = zip [1..] (S.toList is) (shares, usedlocs, _unusedlocs) <- go locs [] want [] _ <- mapM_ obscureShares usedlocs - return (S.fromList shares, sis') + let usedservers = mapMaybe getServer usedlocs + return (S.fromList shares, sis', usedservers) where go unusedlocs usedlocs [] shares = return (shares, usedlocs, unusedlocs) go [] usedlocs _ shares = return (shares, usedlocs, []) |