From a4d44679ddaafdc0ba205746e8eb8850e07f5216 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Fri, 27 Mar 2015 00:01:21 +0100 Subject: Add entryhash files when merging --- src/frontend.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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. -- cgit v1.1