summaryrefslogtreecommitdiff
path: root/src/db.hrl
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-09-18 13:00:44 +0200
committerLinus Nordberg <linus@nordberg.se>2014-09-18 13:00:44 +0200
commite84b362eb7f5dbdea44c811534521f89707f66b4 (patch)
tree727fd71a302b79ec43fc13b4c31cda2e0186fd53 /src/db.hrl
parenta34637a8162aa0cbd8835513bc143e051dd1e503 (diff)
Add field 'mtlhash' to the database, for get-proof-by-hash.
Also, in db: Add field 'mtlhash' to record 'plop'. Rename 'hash' -> 'entryhash'. Add leaf_hash(), calculating a leaf hash from data. Fix a bug where print_tree() print half a byte of the hashes. Rename tree_hash() -> root(). Closes CATLFISH-3.
Diffstat (limited to 'src/db.hrl')
-rw-r--r--src/db.hrl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/db.hrl b/src/db.hrl
index 3914a8c..b5ceb2e 100644
--- a/src/db.hrl
+++ b/src/db.hrl
@@ -2,10 +2,14 @@
%%% See LICENSE for licensing information.
%% @doc What's stored in the database.
-%% 'index' is the primary key, 'hash' is also indexed.
+%% 'index' is the primary key, 'entryhash' and 'mtlhash' are also
+%% indexed, see init_tables/1.
+%% NOTE: Don't change anything here without also fixing
+%% select_index/2, which depends on the order of fields.
-record(plop, {
index :: non_neg_integer(), % Primary key.
- hash :: binary(), % Hash over #plop_entry{} in mtl.
+ entryhash :: binary(), % Hash over #plop_entry{} in mtl.
+ mtlhash :: binary(), % Merkle Tree Leaf hash.
mtl :: mtl(), % Merkle Tree Leaf.
spt :: spt() % Signed Plop Timestamp.
}).