From f9dd92d6b479607fd232a3c599c2d3dae3463412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Wed, 18 Jul 2018 20:20:04 +0200 Subject: [PATCH] Shell/RPC: fix filtering of `next_protocols` in `GET /monitor/heads` --- src/lib_shell/monitor_directory.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib_shell/monitor_directory.ml b/src/lib_shell/monitor_directory.ml index 02640c591..7f8f9f4f8 100644 --- a/src/lib_shell/monitor_directory.ml +++ b/src/lib_shell/monitor_directory.ml @@ -125,7 +125,10 @@ let build_rpc_directory validator mainchain_validator = else Lwt.return_none) block_stream in - let first_call = ref true in + in_next_protocols head >>= fun first_block_is_among_next_protocols -> + let first_call = + (* Skip the first block if this is false *) + ref first_block_is_among_next_protocols in let next () = if !first_call then begin first_call := false ; Lwt.return_some (State.Block.hash head, State.Block.header head)