Exemple #1
0
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
    // -regtest mode: always use testnet rules
    if (Params().AllowMinDifficultyBlocks() && Params().MineBlocksOnDemand()) {
        return GetNextWorkRequired_V1(pindexLast, pblock);
    }
    if (pindexLast->nHeight+1 >= 451000 || (Params().AllowMinDifficultyBlocks() && pindexLast->nHeight+1 >= 300000)) {
        return AntiGravityWave(pindexLast, pblock, 2);
    } else if (pindexLast->nHeight+1 >= 3600) {
        return AntiGravityWave(pindexLast, pblock, 1);
    } else {
        return GetNextWorkRequired_V1(pindexLast, pblock);
    }
}
Exemple #2
0
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
    if (pindexLast->nHeight+1 >= 451000 || (Params().AllowMinDifficultyBlocks() && pindexLast->nHeight+1 >= 300000)) {
        return AntiGravityWave(pindexLast, pblock, 2);
    } else if (pindexLast->nHeight+1 >= 3600) {
        return AntiGravityWave(pindexLast, pblock, 1);
    } else {
        return GetNextWorkRequired_V1(pindexLast, pblock);
    }
}
// Machinecoin: Select retargeting
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{
    assert(pindexLast != nullptr);
    if (pindexLast->nHeight+1 < 76000)
    {
        return GetNextWorkRequired_V1(pindexLast, pblock, params); // Machinecoin: Standard retargeting (V1)
    }
    else if (pindexLast->nHeight+1 < 329529)
    {
        return GetNextWorkRequired_V2(pindexLast, pblock, params); // Machinecoin: Digishield retargeting (V2)
    }
    else if (pindexLast->nHeight+1 < 330000)
    {
        return UintToArith256(params.powLimit).GetCompact();       // Machinecoin: Retargeting to support the PoW change phase (V3)
    }
    else if (pindexLast->nHeight+1 < 468500)
    {
        return GetNextWorkRequired_V2(pindexLast, pblock, params); // Machinecoin: Digishield retargeting (V2)
    }
    else
    {
        return GetNextWorkRequired_V3(pindexLast, pblock, params); // Machinecoin: Octopus retargeting (V3)
    }
}
Exemple #4
0
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
        if (pindexLast->nHeight+1 >= 3600) { return DarkGravityWave3(pindexLast, pblock); }

        return GetNextWorkRequired_V1(pindexLast, pblock);
}