aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r--src/cryptonote_core/blockchain.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 966e98f7e..fb7e5c4f8 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -310,6 +310,22 @@ namespace cryptonote
difficulty_type get_difficulty_for_next_block();
/**
+ * @brief check currently stored difficulties against difficulty checkpoints
+ *
+ * @return {flag, height} flag: true if all difficulty checkpoints pass, height: the last checkpoint height before the difficulty drift bug starts
+ */
+ std::pair<bool, uint64_t> check_difficulty_checkpoints() const;
+
+ /**
+ * @brief recalculate difficulties for blocks after the last difficulty checkpoints to circumvent the annoying 'difficulty drift' bug
+ *
+ * @param start_height: if omitted, starts recalculation from the last difficulty checkpoint
+ *
+ * @return number of blocks whose difficulties got corrected
+ */
+ size_t recalculate_difficulties(boost::optional<uint64_t> start_height = boost::none);
+
+ /**
* @brief adds a block to the blockchain
*
* Adds a new block to the blockchain. If the block's parent is not the