Fix cost calculation for non-encrypted remotes.

Encyptable types of remotes that were not actually encrypted still had
the encryptedRemoteCostAdj applied to their configured cost, which was a
bug.
This commit is contained in:
Joey Hess 2014-07-25 17:29:59 -04:00
parent 014794f4ed
commit 005aded3e0
2 changed files with 5 additions and 1 deletions

View file

@ -87,7 +87,10 @@ encryptableRemote c storeKeyEncrypted retrieveKeyFileEncrypted r =
retrieveKeyFileCheap = retrieveCheap,
removeKey = withkey $ removeKey r,
hasKey = withkey $ hasKey r,
cost = cost r + encryptedRemoteCostAdj
cost = maybe
(cost r)
(const $ cost r + encryptedRemoteCostAdj)
(extractCipher c)
}
where
store k f p = cip k >>= maybe