From 7500743a4d52f7fc857a2b2111bfe9b2663dc1b1 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Mon, 18 Jun 2018 18:51:50 +0200 Subject: [PATCH] Baker: record max level at each block, not each nonce revelation --- src/proto_alpha/lib_delegate/client_baking_lib.ml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/proto_alpha/lib_delegate/client_baking_lib.ml b/src/proto_alpha/lib_delegate/client_baking_lib.ml index 6a90968c7..f255e8365 100644 --- a/src/proto_alpha/lib_delegate/client_baking_lib.ml +++ b/src/proto_alpha/lib_delegate/client_baking_lib.ml @@ -42,13 +42,11 @@ let bake_block (cctxt : #Proto_alpha.full) ?force ?seed_nonce_hash ~src_sk block ~priority:(`Auto (delegate, max_priority)) () >>=? fun block_hash -> - begin - let src_pkh = Signature.Public_key.hash src_pk in - match seed_nonce with + let src_pkh = Signature.Public_key.hash src_pk in + Client_baking_forge.State.record cctxt src_pkh level.level >>=? fun () -> + begin match seed_nonce with | None -> return () | Some seed_nonce -> - Client_baking_forge.State.record cctxt src_pkh level.level - >>=? fun () -> Client_baking_nonces.add cctxt block_hash seed_nonce |> trace_exn (Failure "Error while recording block") end >>=? fun () ->