diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index f64f77975..5c3ff2a14 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -23,9 +23,16 @@ (* *) (*****************************************************************************) +let await_bootstrapped_node (cctxt: #Proto_alpha.full) = + (* Waiting for the node to be synchronized *) + cctxt#message "Waiting for the node to be synchronized with the its \ + peers..." >>= fun () -> + Shell_services.Monitor.bootstrapped cctxt + module Endorser = struct let run (cctxt : #Proto_alpha.full) ~delay ?min_date delegates = + await_bootstrapped_node cctxt >>=? fun _ -> Client_baking_blocks.monitor_heads ~next_protocols:(Some [Proto_alpha.hash]) cctxt `Main >>=? fun block_stream -> @@ -38,6 +45,7 @@ end module Baker = struct let run (cctxt : #Proto_alpha.full) ?fee_threshold ?max_priority ?min_date ~context_path delegates = + await_bootstrapped_node cctxt >>=? fun _ -> Client_baking_blocks.monitor_heads ~next_protocols:(Some [Proto_alpha.hash]) cctxt `Main >>=? fun block_stream -> @@ -51,6 +59,7 @@ end module Accuser = struct let run (cctxt : #Proto_alpha.full) ~preserved_levels = + await_bootstrapped_node cctxt >>=? fun _ -> Client_baking_blocks.monitor_valid_blocks ~next_protocols:(Some [Proto_alpha.hash]) cctxt ~chains:[ `Main ] () >>=? fun valid_blocks_stream ->