From 5f8b74e96c889f71a573232c9693c1030fc0dd68 Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Wed, 30 Nov 2016 14:48:21 +0100 Subject: [PATCH] P2P: Cancel MA computations on client disconnect --- src/node/net/p2p.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/net/p2p.ml b/src/node/net/p2p.ml index 0f9ac312f..5eb0fb4ca 100644 --- a/src/node/net/p2p.ml +++ b/src/node/net/p2p.ml @@ -494,7 +494,7 @@ module Make (P: PARAMS) = struct let received = !counter in ma#add_int (received - old_received); inner received in - Lwt.async (fun () -> inner !counter) + Lwt.async (fun () -> Lwt.pick [cancelation (); inner !counter]) in (* net object state *) let last = ref (Unix.gettimeofday ()) in