diff options
Diffstat (limited to 'src/storagedb.erl')
-rw-r--r-- | src/storagedb.erl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/storagedb.erl b/src/storagedb.erl index d781033..9f7da37 100644 --- a/src/storagedb.erl +++ b/src/storagedb.erl @@ -31,11 +31,11 @@ lastverifiednewentry_path() -> %% Public API. fetchnewhashes(Index) -> - case index:indexsize(newentries_path()) of + case index:indexsize(newentries_db) of 0 -> []; Size -> - index:getrange(newentries_path(), Index, Size - 1) + index:getrange(newentries_db, Index, Size - 1) end. lastverifiednewentry() -> @@ -52,7 +52,7 @@ lastverifiednewentry() -> -spec add(binary()) -> ok. add(LeafHash) -> ok = call(?MODULE, {add_nosync, LeafHash}), - ok = index:sync(newentries_path()), + ok = index:sync(newentries_db), ok. %%%%%%%%%%%%%%%%%%%% @@ -73,13 +73,9 @@ terminate(_Reason, _State) -> %%%%%%%%%%%%%%%%%%%% -newentries_path() -> - {ok, Value} = application:get_env(plop, newentries_path), - Value. - handle_call(stop, _From, State) -> {stop, normal, stopped, State}; handle_call({add_nosync, LeafHash}, _From, State) -> - ok = index:addlast_nosync(newentries_path(), LeafHash), + ok = index:addlast_nosync(newentries_db, LeafHash), {reply, ok, State}. |