aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/hardfork.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-29 19:55:49 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:29:02 +0100
commit59a66e209a844ac6d4221f7c04141b32fa2823c3 (patch)
treea7307663fea9cccad2a0c0bcd5c26469524c9e98 /tests/unit_tests/hardfork.cpp
parentrct: add the tx prefix hash into the MLSAG (diff)
downloadmonero-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 'tests/unit_tests/hardfork.cpp')
-rw-r--r--tests/unit_tests/hardfork.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/unit_tests/hardfork.cpp b/tests/unit_tests/hardfork.cpp
index 1eb73e156..a279b6c68 100644
--- a/tests/unit_tests/hardfork.cpp
+++ b/tests/unit_tests/hardfork.cpp
@@ -96,14 +96,10 @@ public:
virtual void remove_block() { blocks.pop_back(); }
virtual uint64_t add_transaction_data(const crypto::hash& blk_hash, const transaction& tx, const crypto::hash& tx_hash) {return 0;}
virtual void remove_transaction_data(const crypto::hash& tx_hash, const transaction& tx) {}
- 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) {return 0;}
+ 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 rct::key *commitment) {return 0;}
virtual void add_tx_amount_output_indices(const uint64_t tx_index, const std::vector<uint64_t>& amount_output_indices) {}
virtual void add_spent_key(const crypto::key_image& k_image) {}
virtual void remove_spent_key(const crypto::key_image& k_image) {}
- virtual uint64_t get_num_rct_outputs() const { return 0; }
- virtual rct::key get_rct_commitment(uint64_t idx) const { return rct::key(); }
- virtual uint64_t add_rct_commitment(const rct::key &commitment) { return 0; }
- virtual void remove_rct_commitment(uint64_t idx) {}
virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const { return true; }
virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const { return true; }