simplify interface by removing size
Add size to the returned key after the fact, unless the remote happened to add it itself.
This commit is contained in:
parent
85cd79ea01
commit
57cceac569
3 changed files with 8 additions and 4 deletions
|
@ -391,7 +391,11 @@ importKeys remote importtreeconfig importcontent importablecontents = do
|
|||
Nothing -> error "internal" -- checked earlier
|
||||
Just a -> do
|
||||
let importer p = do
|
||||
k <- a loc cid sz p
|
||||
unsizedk <- a loc cid p
|
||||
-- This avoids every remote needing
|
||||
-- to add the size.
|
||||
let k = alterKey unsizedk $ \kd -> kd
|
||||
{ keySize = keySize kd <|> Just sz }
|
||||
checkSecureHashes k >>= \case
|
||||
Nothing -> do
|
||||
recordcidkey cidmap db cid k
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue