Alpha: do not delete delegate change of an empty delegate account

This commit is contained in:
bruno 2018-06-28 16:48:34 +02:00 committed by Benjamin Canou
parent ac58132588
commit a2bc2c4aad

View File

@ -301,10 +301,6 @@ module Delegate = struct
if inactive then return (c, change) else loop c change
end >>=? fun (c, change) ->
Lwt.return Tez_repr.(change -? amount) >>=? fun change ->
Storage.Roll.Delegate_roll_list.mem c delegate >>= fun rolls ->
if not inactive && Tez_repr.(change = zero) && not rolls then
Storage.Roll.Delegate_change.delete c delegate
else
Storage.Roll.Delegate_change.set c delegate change
let set_inactive ctxt delegate =