aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.h
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2020-05-15 10:56:23 +0900
committerstoffu <stoffu@protonmail.ch>2020-06-09 10:40:51 +0900
commit7bd66b01bfb62ecaf8ff02b20d14db3a77322abc (patch)
treec6a4db2a82193471570360734f4c4955271a69ba /src/blockchain_db/lmdb/db_lmdb.h
parentMerge pull request #6576 (diff)
downloadmonero-7bd66b01bfb62ecaf8ff02b20d14db3a77322abc.tar.xz
daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation
On startup, it checks against the difficulty checkpoints, and if any mismatch is found, recalculates all the blocks with wrong difficulties. Additionally, once a week it recalculates difficulties of blocks after the last difficulty checkpoint.
Diffstat (limited to '')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h
index 6ddeed671..0213c1342 100644
--- a/src/blockchain_db/lmdb/db_lmdb.h
+++ b/src/blockchain_db/lmdb/db_lmdb.h
@@ -229,6 +229,8 @@ public:
virtual difficulty_type get_block_difficulty(const uint64_t& height) const;
+ virtual void correct_block_cumulative_difficulties(const uint64_t& start_height, const std::vector<difficulty_type>& new_cumulative_difficulties);
+
virtual uint64_t get_block_already_generated_coins(const uint64_t& height) const;
virtual uint64_t get_block_long_term_weight(const uint64_t& height) const;