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.
This commit is contained in:
Raphaël Proust 2018-06-13 09:14:54 +08:00 committed by Grégoire Henry
parent 16ea7da81d
commit ac06ccf935

View File

@ -56,7 +56,7 @@ end = struct
let rec remove_old acc = function let rec remove_old acc = function
| [] -> List.rev acc | [] -> List.rev acc
| ((_,lvl) as hd)::tl -> | ((_,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 remove_old (hd::acc) tl
else else
List.rev acc List.rev acc