summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-09-15 14:55:27 +0200
committerLinus Nordberg <linus@nordberg.se>2014-09-15 14:55:27 +0200
commiteade837db3855ac52b0fc2c3f62e83ceb62b37a7 (patch)
tree500d9ba10b7a8d8d01b5e2d6125ae0a023a87e45
parent4515b324035c1b3969973ebeeeaf96223fe53aa1 (diff)
Have inclusion/2 return Index too.
-rw-r--r--src/plop.erl10
1 files changed, 5 insertions, 5 deletions
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}) ->