Difficulty retarget: exact port of pow.cpp CalculateNextWorkRequired.
firstTime is the timestamp of the FIRST block of the closing period
(height H-interval for a boundary at H), lastTime of its LAST block
(height H-1). Bitcoin's off-by-one 2015-block window, faithfully kept.
Multiplication precedes division (consensus truncation order).
Difficulty retarget: exact port of pow.cpp CalculateNextWorkRequired.
firstTimeis the timestamp of the FIRST block of the closing period (height H-interval for a boundary at H),lastTimeof its LAST block (height H-1). Bitcoin's off-by-one 2015-block window, faithfully kept. Multiplication precedes division (consensus truncation order).