From 534dc6af9d400e294f4f0fa1ea0e778b14971723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Sat, 4 Mar 2017 09:54:16 +0100 Subject: [PATCH] Shell: the genesis block should not flag the node as 'bootstraped' --- src/node/shell/validator.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/node/shell/validator.ml b/src/node/shell/validator.ml index cf23f2b27..14f4659a8 100644 --- a/src/node/shell/validator.ml +++ b/src/node/shell/validator.ml @@ -504,7 +504,13 @@ let rec create_validator ?parent worker state db net = | Some block when Time.(block.State.Valid_block.timestamp < add (Time.now ()) (-60L)) -> wait () - | Some _ | None -> Lwt.return_unit in + | _ -> + State.Valid_block.Current.head net >>= fun head -> + State.Valid_block.Current.genesis net >>= fun genesis -> + if Block_hash.equal head.hash genesis.hash then + wait () + else + Lwt.return_unit in let t = wait () >>= fun () -> Watcher.shutdown stopper ;