diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-29 19:55:49 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:29:02 +0100 |
commit | 59a66e209a844ac6d4221f7c04141b32fa2823c3 (patch) | |
tree | a7307663fea9cccad2a0c0bcd5c26469524c9e98 /src/blockchain_db/lmdb/db_lmdb.h | |
parent | rct: add the tx prefix hash into the MLSAG (diff) | |
download | monero-59a66e209a844ac6d4221f7c04141b32fa2823c3.tar.xz |
move the rct commitments to the output_amounts database
Since these are needed at the same time as the output pubkeys,
this is a whole lot faster, and takes less space. Only outputs
of 0 amount store the commitment. When reading other outputs,
a fake commitment is regenerated on the fly. This avoids having
to rewrite the database to add space for fake commitments for
existing outputs.
This code relies on two things:
- LMDB must support fixed size records per key, rather than
per database (ie, all records on key 0 are the same size, all
records for non 0 keys are same size, but records from key 0
and non 0 keys do have different sizes).
- the commitment must be directly after the rest of the data
in outkey and output_data_t.
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h index 9e92b0661..050e9e0ae 100644 --- a/src/blockchain_db/lmdb/db_lmdb.h +++ b/src/blockchain_db/lmdb/db_lmdb.h @@ -55,8 +55,6 @@ typedef struct mdb_txn_cursors MDB_cursor *m_txc_spent_keys; - MDB_cursor *m_txc_rct_commitments; - MDB_cursor *m_txc_hf_versions; } mdb_txn_cursors; @@ -69,7 +67,6 @@ typedef struct mdb_txn_cursors #define m_cur_tx_indices m_cursors->m_txc_tx_indices #define m_cur_tx_outputs m_cursors->m_txc_tx_outputs #define m_cur_spent_keys m_cursors->m_txc_spent_keys -#define m_cur_rct_commitments m_cursors->m_txc_rct_commitments #define m_cur_hf_versions m_cursors->m_txc_hf_versions typedef struct mdb_rflags @@ -84,7 +81,6 @@ typedef struct mdb_rflags bool m_rf_tx_indices; bool m_rf_tx_outputs; bool m_rf_spent_keys; - bool m_rf_rct_commitments; bool m_rf_hf_versions; } mdb_rflags; @@ -236,11 +232,6 @@ public: virtual bool has_key_image(const crypto::key_image& img) const; - virtual uint64_t get_num_rct_outputs() const; - virtual rct::key get_rct_commitment(uint64_t idx) const; - virtual uint64_t add_rct_commitment(const rct::key &commitment); - virtual void remove_rct_commitment(uint64_t idx); - virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const; virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const; virtual bool for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)>) const; @@ -302,7 +293,8 @@ private: virtual uint64_t add_output(const crypto::hash& tx_hash, const tx_out& tx_output, const uint64_t& local_index, - const uint64_t unlock_time + const uint64_t unlock_time, + const rct::key *commitment ); virtual void add_tx_amount_output_indices(const uint64_t tx_id, @@ -369,8 +361,6 @@ private: MDB_dbi m_spent_keys; - MDB_dbi m_rct_commitments; - MDB_dbi m_hf_starting_heights; MDB_dbi m_hf_versions; |