Alpha: do not delete delegate change of an empty delegate account
This commit is contained in:
parent
ac58132588
commit
a2bc2c4aad
@ -301,11 +301,7 @@ module Delegate = struct
|
|||||||
if inactive then return (c, change) else loop c change
|
if inactive then return (c, change) else loop c change
|
||||||
end >>=? fun (c, change) ->
|
end >>=? fun (c, change) ->
|
||||||
Lwt.return Tez_repr.(change -? amount) >>=? fun change ->
|
Lwt.return Tez_repr.(change -? amount) >>=? fun change ->
|
||||||
Storage.Roll.Delegate_roll_list.mem c delegate >>= fun rolls ->
|
Storage.Roll.Delegate_change.set c delegate change
|
||||||
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 =
|
let set_inactive ctxt delegate =
|
||||||
ensure_inited ctxt delegate >>=? fun ctxt ->
|
ensure_inited ctxt delegate >>=? fun ctxt ->
|
||||||
|
Loading…
Reference in New Issue
Block a user