From ec12edeb91e73e3d0a5474162c7dec6c56750ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 6 Mar 2017 19:06:39 +0100 Subject: [PATCH] Proto/Alpha: fix mining right timestamp --- src/proto/alpha/mining.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto/alpha/mining.ml b/src/proto/alpha/mining.ml index 41d766945..38a9c5b4a 100644 --- a/src/proto/alpha/mining.ml +++ b/src/proto/alpha/mining.ml @@ -37,7 +37,7 @@ let () = let minimal_time c priority pred_timestamp = let rec cumsum_slot_durations acc durations p = - if Compare.Int32.(=) p 0l then + if Compare.Int32.(<=) p 0l then ok acc else match durations with | [] -> Error_monad.error Invalid_slot_durations_constant @@ -50,7 +50,7 @@ let minimal_time c priority pred_timestamp = cumsum_slot_durations acc durations p in Lwt.return (cumsum_slot_durations - pred_timestamp (Constants.slot_durations c) priority) + pred_timestamp (Constants.slot_durations c) (Int32.succ priority)) let check_timestamp c priority pred_timestamp = minimal_time c priority pred_timestamp >>=? fun minimal_time ->