aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-07-19 03:36:39 -0700
committerAlexander Blair <snipa@jagtech.io>2020-07-19 03:36:39 -0700
commit36d50d93f295d4b193e73f3ff3e95ae7e050c767 (patch)
treec8c7b69c5b0f769fdf1f72460462851597506d88 /src/blockchain_db/blockchain_db.h
parentMerge pull request #6529 (diff)
parentdaemon: guard against rare 'difficulty drift' bug with checkpoints and recalc... (diff)
downloadmonero-36d50d93f295d4b193e73f3ff3e95ae7e050c767.tar.xz
Merge pull request #6534
7bd66b01b daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation (stoffu)
Diffstat (limited to 'src/blockchain_db/blockchain_db.h')
-rw-r--r--src/blockchain_db/blockchain_db.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index f695cb659..f513651ed 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -1039,6 +1039,16 @@ public:
virtual difficulty_type get_block_difficulty(const uint64_t& height) const = 0;
/**
+ * @brief correct blocks cumulative difficulties that were incorrectly calculated due to the 'difficulty drift' bug
+ *
+ * If the block does not exist, the subclass should throw BLOCK_DNE
+ *
+ * @param start_height the height where the drift starts
+ * @param new_cumulative_difficulties new cumulative difficulties to be stored
+ */
+ virtual void correct_block_cumulative_difficulties(const uint64_t& start_height, const std::vector<difficulty_type>& new_cumulative_difficulties) = 0;
+
+ /**
* @brief fetch a block's already generated coins
*
* The subclass should return the total coins generated as of the block