From ac06ccf935ec4b19413575683c2f0ffda290acb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Wed, 13 Jun 2018 09:14:54 +0800 Subject: [PATCH] Alpha/Endorser: bugfix When removing old endorsments from the wallet (to avoid it growing), only old endorsments were kept, or no endorsments at all were kept. In addition, that function relied on the endorsments being sorted by level. --- src/proto_alpha/lib_delegate/client_baking_endorsement.ml | 2 +- 1 file changed, 1 insertion(+), 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 0f2d61907..ed295515b 100644 --- a/src/proto_alpha/lib_delegate/client_baking_endorsement.ml +++ b/src/proto_alpha/lib_delegate/client_baking_endorsement.ml @@ -56,7 +56,7 @@ end = struct let rec remove_old acc = function | [] -> List.rev acc | ((_,lvl) as hd)::tl -> - if Raw_level.diff new_lvl lvl > 50l (*?*) then + if Raw_level.diff new_lvl lvl < 50l (*?*) then remove_old (hd::acc) tl else List.rev acc