aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-04 14:18:37 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:28:11 +0100
commiteb56d0f9941d4aed9d89a20007221cecd1dc6cbc (patch)
treed64620722d53d8e5aa07d14eb40c7377a5158471 /src/blockchain_db/blockchain_db.h
parentringct: restore verRange check in debug mode (diff)
downloadmonero-eb56d0f9941d4aed9d89a20007221cecd1dc6cbc.tar.xz
blockchain_db: add functions for adding/removing/getting rct commitments
Diffstat (limited to 'src/blockchain_db/blockchain_db.h')
-rw-r--r--src/blockchain_db/blockchain_db.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index 4c2157a39..5b759db4c 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -1200,6 +1200,39 @@ public:
virtual bool has_key_image(const crypto::key_image& img) const = 0;
/**
+ * @brief returns the number of ringct outputs in the database
+ *
+ * @return the number of ringct outputs in the database
+ */
+ virtual uint64_t get_num_rct_outputs() const = 0;
+
+ /**
+ * @brief returns the commitment for a given ringct output
+ *
+ * Throws OUTPUT_DNE if the index is out of range
+ * Throws DB_ERROR on other error
+ *
+ * @return the commitment for the given index
+ */
+ virtual rct::key get_rct_commitment(uint64_t idx) const = 0;
+
+ /**
+ * @brief Adds a new ringct output with the given commitment
+ *
+ * Throws DB_ERROR if the addition fails
+ *
+ * @return the index of the newly added record
+ */
+ virtual uint64_t add_rct_commitment(const rct::key &commitment) = 0;
+
+ /**
+ * @brief Remove a ringct output with the given index
+ *
+ * Throws DB_ERROR if the removal fails
+ */
+ virtual void remove_rct_commitment(uint64_t idx) = 0;
+
+ /**
* @brief runs a function over all key images stored
*
* The subclass should run the passed function for each key image it has