Module difficulty

Source
Expand description

Difficulty Module

This module handles keeping track of the data required to calculate block difficulty. This data is currently the cumulative difficulty of each block and its timestamp.

The timestamps are also used in other consensus rules so instead of duplicating the same data in a different cache, the timestamps needed are retrieved from here.

Structsยง

DifficultyCache
This struct is able to calculate difficulties from blockchain information.
DifficultyCacheConfig
Configuration for the difficulty cache.