summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-22 14:08:36 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-22 14:08:36 -0400
commit3eb522469e641e31d02fa060a1b48b93edbf7d84 (patch)
tree5d107b396c60822cf16f919e806d3fa9d042beb0 /Storage.hs
parentfc143a225540c49a0d7f4b9e1bb0345a89260ea5 (diff)
downloadkeysafe-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.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Storage.hs b/Storage.hs
index aa52d7c..fcd2f7e 100644
--- a/Storage.hs
+++ b/Storage.hs
@@ -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, [])