Client: minor fix in the daemon.

This commit is contained in:
Grégoire Henry 2017-04-10 22:58:36 +02:00
parent 5a21f3c159
commit 3b5a3eb509

View File

@ -83,16 +83,17 @@ let get_key cctxt pkh =
let get_keys cctxt = let get_keys cctxt =
Secret_key.load cctxt >>=? fun sks -> Secret_key.load cctxt >>=? fun sks ->
map_filter_s Lwt_list.filter_map_s
(fun (name, sk) -> (fun (name, sk) ->
Lwt.catch begin fun () -> begin
Public_key.find cctxt name >>=? fun pk -> Public_key.find cctxt name >>=? fun pk ->
Public_key_hash.find cctxt name >>=? fun pkh -> Public_key_hash.find cctxt name >>=? fun pkh ->
return (Some (name, pkh, pk, sk)) return (name, pkh, pk, sk)
end begin fun _ -> end >>= function
return None | Ok r -> Lwt.return (Some r)
end) | Error _ -> Lwt.return_none)
sks sks >>= fun keys ->
return keys
let list_keys cctxt = let list_keys cctxt =
Public_key_hash.load cctxt >>=? fun l -> Public_key_hash.load cctxt >>=? fun l ->