Alpha: fix the doulble roll bug

This commit is contained in:
Pierre Chambart 2018-06-15 00:45:47 +02:00 committed by Benjamin Canou
parent 89f73cceb9
commit c64698be09

View File

@ -117,10 +117,10 @@ let unlink c contract balance =
Storage.Contract.Delegate.get_option c contract >>=? function
| None -> return c
| Some delegate ->
Roll_storage.Delegate.remove_amount c delegate balance >>=? fun c ->
match Contract_repr.is_originated contract with
| None -> return c
| Some h ->
Roll_storage.Delegate.remove_amount c delegate balance >>=? fun c ->
Storage.Contract.Delegated.del
(c, Contract_repr.implicit_contract delegate) h >>= fun c ->
return c