Signer: Fix high watermarking

Fix 89372a8e28
This commit is contained in:
Pierre Boutillier 2018-11-19 14:48:10 +01:00
parent 1d204cd83c
commit 991b39a2b5
No known key found for this signature in database
GPG Key ID: C2F73508B56A193C

View File

@ -69,10 +69,12 @@ module High_watermark = struct
| Some (previous_level, previous_hash, Some signature) ->
if previous_level > level then
failwith "%s level %ld below high watermark %ld" name level previous_level
else if previous_level = level && previous_hash <> hash then
failwith "%s level %ld already signed with different data" name level
else
return (Some signature)
else if previous_level = level then
if previous_hash <> hash then
failwith "%s level %ld already signed with different data" name level
else
return (Some signature)
else return_none
end >>=? function
| Some signature -> return signature
| None ->