[][src]Function bitcoin_spv::btcspv::retarget_algorithm

pub fn retarget_algorithm(
    previous_target: &BigUint,
    first_timestamp: u32,
    second_timestamp: u32
) -> BigUint

Performs the bitcoin difficulty retarget. Implements the Bitcoin algorithm precisely.

Arguments

  • previous_target - The target of the previous period
  • first_timestamp - The timestamp of the first block in the difficulty period
  • second_timestamp - The timestamp of the last block in the difficulty period