diff options
Diffstat (limited to 'src/frontend.erl')
-rw-r--r-- | src/frontend.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/frontend.erl b/src/frontend.erl index e528419..3977d0e 100644 --- a/src/frontend.erl +++ b/src/frontend.erl @@ -121,11 +121,14 @@ check_entries(Entries, Start, End) -> end end, [], lists:zip(Entries, lists:seq(Start, End))). -check_entry(Hash, Index) -> - case db:get_by_leaf_hash(Hash) of +check_entry(LeafHash, Index) -> + case db:get_by_leaf_hash(LeafHash) of notfound -> {notfound, Index}; - _ -> + {Index, LeafHash, Entry} -> + {ok, {Module, Function}} = application:get_env(plop, entryhash_from_entry), + EntryHash = Module:Function(Entry), + ok = db:add_entryhash(LeafHash, EntryHash), ok end. |