Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <pow.h>
#include <arith_uint256.h>
#include <chain.h>
#include <chainparams.h>
#include <primitives/block.h>
#include <uint256.h>
#include <math.h>
Go to the source code of this file.
Functions | |
unsigned static int | KimotoGravityWell (const CBlockIndex *pindexLast, const Consensus::Params ¶ms) |
unsigned static int | DarkGravityWave (const CBlockIndex *pindexLast, const Consensus::Params ¶ms) |
unsigned int | GetNextWorkRequiredBTC (const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params ¶ms) |
unsigned int | GetNextWorkRequired (const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params ¶ms) |
unsigned int | CalculateNextWorkRequired (const CBlockIndex *pindexLast, int64_t nFirstBlockTime, const Consensus::Params ¶ms) |
bool | CheckProofOfWork (uint256 hash, unsigned int nBits, const Consensus::Params ¶ms) |
Check whether a block hash satisfies the proof-of-work requirement specified by nBits. More... | |
Function Documentation
◆ CalculateNextWorkRequired()
unsigned int CalculateNextWorkRequired | ( | const CBlockIndex * | pindexLast, |
int64_t | nFirstBlockTime, | ||
const Consensus::Params & | params | ||
) |
Definition at line 208 of file pow.cpp.
References Consensus::Params::fPowNoRetargeting, CBlockIndex::GetBlockTime(), arith_uint256::GetCompact(), CBlockIndex::nBits, Consensus::Params::nPowTargetTimespan, Consensus::Params::powLimit, arith_uint256::SetCompact(), and UintToArith256().
Referenced by GetNextWorkRequiredBTC().
◆ CheckProofOfWork()
bool CheckProofOfWork | ( | uint256 | hash, |
unsigned int | nBits, | ||
const Consensus::Params & | params | ||
) |
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition at line 233 of file pow.cpp.
References Consensus::Params::powLimit, arith_uint256::SetCompact(), and UintToArith256().
Referenced by CheckBlockHeader(), CBlockTreeDB::LoadBlockIndexGuts(), and ReadBlockFromDisk().
◆ DarkGravityWave()
|
static |
Definition at line 82 of file pow.cpp.
References CBlockIndex::GetBlockTime(), arith_uint256::GetCompact(), CBlockIndex::nBits, CBlockIndex::nHeight, Consensus::Params::nPowTargetSpacing, Consensus::Params::powLimit, CBlockIndex::pprev, arith_uint256::SetCompact(), and UintToArith256().
Referenced by GetNextWorkRequired().
◆ GetNextWorkRequired()
unsigned int GetNextWorkRequired | ( | const CBlockIndex * | pindexLast, |
const CBlockHeader * | pblock, | ||
const Consensus::Params & | params | ||
) |
Definition at line 168 of file pow.cpp.
References DarkGravityWave(), Consensus::Params::fPowAllowMinDifficultyBlocks, CBlockHeader::GetBlockTime(), CBlockIndex::GetBlockTime(), arith_uint256::GetCompact(), GetNextWorkRequiredBTC(), KimotoGravityWell(), CBlockIndex::nBits, CBlockIndex::nHeight, Consensus::Params::nMinimumDifficultyBlocks, Consensus::Params::nPowDGWHeight, Consensus::Params::nPowKGWHeight, Consensus::Params::nPowTargetSpacing, Consensus::Params::powLimit, arith_uint256::SetCompact(), and UintToArith256().
Referenced by ContextualCheckBlockHeader(), BlockAssembler::CreateNewBlock(), and UpdateTime().
◆ GetNextWorkRequiredBTC()
unsigned int GetNextWorkRequiredBTC | ( | const CBlockIndex * | pindexLast, |
const CBlockHeader * | pblock, | ||
const Consensus::Params & | params | ||
) |
Definition at line 132 of file pow.cpp.
References CalculateNextWorkRequired(), Consensus::Params::DifficultyAdjustmentInterval(), Consensus::Params::fPowAllowMinDifficultyBlocks, CBlockIndex::GetAncestor(), CBlockHeader::GetBlockTime(), CBlockIndex::GetBlockTime(), arith_uint256::GetCompact(), CBlockIndex::nBits, CBlockIndex::nHeight, Consensus::Params::nPowTargetSpacing, Consensus::Params::powLimit, CBlockIndex::pprev, and UintToArith256().
Referenced by GetNextWorkRequired().
◆ KimotoGravityWell()
|
static |
Definition at line 16 of file pow.cpp.
References CBlockIndex::GetBlockTime(), arith_uint256::GetCompact(), CBlockIndex::nBits, CBlockIndex::nHeight, Consensus::Params::nPowTargetSpacing, Consensus::Params::nPowTargetTimespan, Consensus::Params::powLimit, CBlockIndex::pprev, arith_uint256::SetCompact(), and UintToArith256().
Referenced by GetNextWorkRequired().