From eade837db3855ac52b0fc2c3f62e83ceb62b37a7 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 15 Sep 2014 14:55:27 +0200 Subject: Have inclusion/2 return Index too. --- src/plop.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plop.erl b/src/plop.erl index bbfb687..81d3cc9 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -151,12 +151,12 @@ handle_call({consistency, {First, Second}}, _From, Plop) -> {reply, ht:consistency(First - 1, Second - 1), Plop}; handle_call({inclusion, {Hash, TreeSize}}, _From, Plop) -> - Proof = case db:find(Hash) of - [] -> []; - {plop, Index, _Hash, _MTL, _SPT} -> - ht:path(Index, TreeSize - 1) + {Index, Proof} = case db:find(Hash) of + [] -> []; + {plop, I, _Hash, _MTL, _SPT} -> + {I, ht:path(I, TreeSize - 1)} end, - {reply, Proof, Plop}; + {reply, {Index, Proof}, Plop}; handle_call({test, pubkey}, _From, Plop = #state{pubkey = PK}) -> -- cgit v1.1