aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-21 14:48:40 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-21 14:48:40 +0200
commit5ac46c5310d68faf05e2f525a9a0c9e834f4f404 (patch)
tree023294d025659053d362d32d7f8b3731e3b6d8a3 /src/blockchain_db/blockchain_db.h
parentMerge pull request #5252 (diff)
parentblockchain: speed up getting N blocks weights/long term weights (diff)
downloadmonero-5ac46c5310d68faf05e2f525a9a0c9e834f4f404.tar.xz
Merge pull request #5256
4b21d38d blockchain: speed up getting N blocks weights/long term weights (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/blockchain_db.h')
-rw-r--r--src/blockchain_db/blockchain_db.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index 313e716e0..d2fe39fc2 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -947,6 +947,17 @@ public:
virtual size_t get_block_weight(const uint64_t& height) const = 0;
/**
+ * @brief fetch the last N blocks' weights
+ *
+ * If there are fewer than N blocks, the returned array will be smaller than N
+ *
+ * @param count the number of blocks requested
+ *
+ * @return the weights
+ */
+ virtual std::vector<uint64_t> get_block_weights(uint64_t start_height, size_t count) const = 0;
+
+ /**
* @brief fetch a block's cumulative difficulty
*
* The subclass should return the cumulative difficulty of the block with the
@@ -1000,6 +1011,17 @@ public:
virtual uint64_t get_block_long_term_weight(const uint64_t& height) const = 0;
/**
+ * @brief fetch the last N blocks' long term weights
+ *
+ * If there are fewer than N blocks, the returned array will be smaller than N
+ *
+ * @param count the number of blocks requested
+ *
+ * @return the weights
+ */
+ virtual std::vector<uint64_t> get_long_term_block_weights(uint64_t start_height, size_t count) const = 0;
+
+ /**
* @brief fetch a block's hash
*
* The subclass should return hash of the block with the