aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_db/blockchain_db.h')
-rw-r--r--src/blockchain_db/blockchain_db.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index e8e2bfdee..6851e2404 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -148,6 +148,7 @@ struct txpool_tx_meta_t
uint8_t relayed;
uint8_t do_not_relay;
uint8_t double_spend_seen: 1;
+ uint8_t bf_padding: 7;
uint8_t padding[76]; // till 192 bytes
};
@@ -366,6 +367,7 @@ private:
, const size_t& block_size
, const difficulty_type& cumulative_difficulty
, const uint64_t& coins_generated
+ , uint64_t num_rct_outs
, const crypto::hash& blk_hash
) = 0;
@@ -654,6 +656,20 @@ public:
*/
virtual std::vector<std::string> get_filenames() const = 0;
+ /**
+ * @brief remove file(s) storing the database
+ *
+ * This function is for resetting the database (for core tests, functional tests, etc).
+ * The function reset() is not usable because it needs to open the database file first
+ * which can fail if the existing database file is in an incompatible format.
+ * As such, this function needs to be called before calling open().
+ *
+ * @param folder The path of the folder containing the database file(s) which must not end with slash '/'.
+ *
+ * @return true if the operation is succesfull
+ */
+ virtual bool remove_data_file(const std::string& folder) const = 0;
+
// return the name of the folder the db's file(s) should reside in
/**
* @brief gets the name of the folder the BlockchainDB's file(s) should be in
@@ -891,6 +907,20 @@ public:
virtual uint64_t get_block_timestamp(const uint64_t& height) const = 0;
/**
+ * @brief fetch a block's cumulative number of rct outputs
+ *
+ * The subclass should return the numer of rct outputs in the blockchain
+ * up to the block with the given height (inclusive).
+ *
+ * If the block does not exist, the subclass should throw BLOCK_DNE
+ *
+ * @param height the height requested
+ *
+ * @return the cumulative number of rct outputs
+ */
+ virtual std::vector<uint64_t> get_block_cumulative_rct_outputs(const std::vector<uint64_t> &heights) const = 0;
+
+ /**
* @brief fetch the top block's timestamp
*
* The subclass should return the timestamp of the most recent block.