diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-09-18 13:00:44 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-09-18 13:00:44 +0200 |
commit | e84b362eb7f5dbdea44c811534521f89707f66b4 (patch) | |
tree | 727fd71a302b79ec43fc13b4c31cda2e0186fd53 /src/db.hrl | |
parent | a34637a8162aa0cbd8835513bc143e051dd1e503 (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.hrl | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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. }). |