From 359f2d6932f5106789cee2927ea41008bf01e9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Wed, 20 Feb 2019 15:02:01 +0100 Subject: [PATCH] P2p: improve cancelation in maintenance --- src/lib_p2p/p2p_maintenance.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib_p2p/p2p_maintenance.ml b/src/lib_p2p/p2p_maintenance.ml index 617281aee..cd8f8df09 100644 --- a/src/lib_p2p/p2p_maintenance.ml +++ b/src/lib_p2p/p2p_maintenance.ml @@ -114,7 +114,9 @@ let rec try_to_contact else List.fold_left (fun acc point -> - P2p_pool.connect pool point >>= function + protect ~canceler:st.canceler begin fun () -> + P2p_pool.connect pool point + end >>= function | Ok _ -> acc >|= succ | Error _ -> acc) (Lwt.return 0)