From 97fe3f5ca9e344b8913e24c8a2559d07da28b316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Wed, 13 Jun 2018 15:04:17 +0800 Subject: [PATCH] Alpha/Endorser: clean-up state after endorsment Remove endorsment slot once it is used. This avoids repeated injection of the same endorsment operation. --- src/proto_alpha/lib_delegate/client_baking_endorsement.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_delegate/client_baking_endorsement.ml b/src/proto_alpha/lib_delegate/client_baking_endorsement.ml index 9e17ca55a..e6778713e 100644 --- a/src/proto_alpha/lib_delegate/client_baking_endorsement.ml +++ b/src/proto_alpha/lib_delegate/client_baking_endorsement.ml @@ -283,7 +283,9 @@ let create last_get_block := None; check_error (prepare_endorsement cctxt ~max_past state bi) | `Timeout -> - check_error (endorse_for cctxt state.to_endorse) + check_error (endorse_for cctxt state.to_endorse) >>= fun () -> + state.to_endorse <- None ; + Lwt.return_unit end >>= fun () -> worker_loop () in