<<  >> (p.5)
    Author Topic: HERE IS HOW THE FORK WILL HAPPEN.  (Read 6484 times)
    cpfreeplz
    Legendary
    *
    Offline Offline

    Activity: 966
    Merit: 1042


    View Profile
    July 29, 2017, 07:19:39 PM
     #81

    - snip -
    Need to generate 1 block at the and of 15 days period and it will cause 4x difficulty  drop.
    - snip -

    Not true.

    Difficulty adjusts after 2016 blocks.  NOT after 15 days.

    If blocks happen at near NORMAL speed (average 1 block every nearly 10 minutes) then difficulty adjusts after approximately 14 days:
    2016 blocks * 10 minutes = 20160 minutes = 336 hours = 14 days

    If there is not enough hash power and therefore blocks take longer, then difficulty takes longer to adjust.

    2016 blocks * average 40 minutes per block = 80640 minutes = 1344 hours = 56 days until difficulty adjusts 4X

    See code here:
    https://github.com/bitcoin/bitcoin/blob/1b046603b30ebfab6199a2f92015d507b248b590/src/pow.cpp#L19

    Specifies params.DifficultyAdjustmentInterval:
    Code:
    // Only change once per difficulty adjustment interval
        if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)
    {
        ...

    params.DifficultyAdjustmentInterval calculated here:
    https://github.com/bitcoin/bitcoin/blob/1b046603b30ebfab6199a2f92015d507b248b590/src/consensus/params.h#L63
    Code:
    int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan nPowTargetSpacing; }

    nPowTargetTimespan is set here:
    https://github.com/bitcoin/bitcoin/blob/1b046603b30ebfab6199a2f92015d507b248b590/src/chainparams.cpp#L79
    Code:
    consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
    Note: 14*24*60*60 = 1209600

    nPowTargetSpacing is set here:
    https://github.com/bitcoin/bitcoin/blob/1b046603b30ebfab6199a2f92015d507b248b590/src/chainparams.cpp#L80
    Code:
    consensus.nPowTargetSpacing = 10 * 60;
    Note: 10 * 60 = 600

    So, DifficultyAdjustmentInterval = 1209600 600 = 2016

    So, adjustment happens when:
    (pindexLast->nHeight+1) === 2016

    In other words...

    Only once every 2016 blocks.



    What I could say on this overwhelmingly mathematical information that bursts into my  small head. This are really amazing.

    I am just the other guy who gladly receiving great information.

    As understanding on the suggestion above. I have to pull out my bitcoin from online and put it to my desktop wallet. To make it safe.

    Now if you're smart you'll keep it off of exchanges for the rest of your life... or you'll be one of these dumbos that shows up only when their bitcoins get hacked off of each exchange they use. Buy your bitcoins then transfer them to yourself. Don't ever trust an exchange.
Page 4
Viewing Page: 5