From 602a10651cb79a99f0589279015b292b93576fb5 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Fri, 10 Nov 2017 09:56:40 +0100 Subject: [PATCH] Prevalidator: log_debug canceled operation fetches --- src/node/shell/prevalidator.ml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/node/shell/prevalidator.ml b/src/node/shell/prevalidator.ml index 059c1d362..bfd6146f4 100644 --- a/src/node/shell/prevalidator.ml +++ b/src/node/shell/prevalidator.ml @@ -243,10 +243,18 @@ let create net_db = let fetch op = Distributed_db.Operation.fetch ~timeout:10. (* TODO allow to adjust the constant ... *) - net_db ~peer:gid op () >>= fun _op -> - push_to_worker (`Handle op) ; - Lwt.return_unit - in + net_db ~peer:gid op () >>= function + | Ok _op -> + push_to_worker (`Handle op) ; + Lwt.return_unit + | Error [ Distributed_db.Operation.Canceled _ ] -> + lwt_debug + "operation %a included before being prevalidated" + Operation_hash.pp_short op >>= fun () -> + Lwt.return_unit + | Error _ -> + (* should not happen *) + Lwt.return_unit in List.iter (fun op -> Operation_hash.Table.add pending op (fetch op)) unknown_ops ;