Dash Core  0.12.2.1
P2P Digital Currency
pow.cpp File Reference
#include "pow.h"
#include "arith_uint256.h"
#include "chain.h"
#include "chainparams.h"
#include "primitives/block.h"
#include "uint256.h"
#include "util.h"
#include <math.h>

Go to the source code of this file.

Functions

unsigned static int KimotoGravityWell (const CBlockIndex *pindexLast, const Consensus::Params &params)
 
unsigned static int DarkGravityWave (const CBlockIndex *pindexLast, const Consensus::Params &params)
 
unsigned int GetNextWorkRequiredBTC (const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &params)
 
unsigned int GetNextWorkRequired (const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &params)
 
unsigned int CalculateNextWorkRequired (const CBlockIndex *pindexLast, int64_t nFirstBlockTime, const Consensus::Params &params)
 
bool CheckProofOfWork (uint256 hash, unsigned int nBits, const Consensus::Params &params)
 
arith_uint256 GetBlockProof (const CBlockIndex &block)
 
int64_t GetBlockProofEquivalentTime (const CBlockIndex &to, const CBlockIndex &from, const CBlockIndex &tip, const Consensus::Params &params)
 

Function Documentation

◆ CalculateNextWorkRequired()

unsigned int CalculateNextWorkRequired ( const CBlockIndex pindexLast,
int64_t  nFirstBlockTime,
const Consensus::Params params 
)

debug print

Definition at line 204 of file pow.cpp.

Referenced by GetNextWorkRequiredBTC().

◆ CheckProofOfWork()

bool CheckProofOfWork ( uint256  hash,
unsigned int  nBits,
const Consensus::Params  
)

Check whether a block hash satisfies the proof-of-work requirement specified by nBits

Definition at line 238 of file pow.cpp.

Referenced by CheckBlockHeader(), generate(), CBlockTreeDB::LoadBlockIndexGuts(), and ReadBlockFromDisk().

◆ DarkGravityWave()

unsigned static int DarkGravityWave ( const CBlockIndex pindexLast,
const Consensus::Params params 
)
static

Definition at line 83 of file pow.cpp.

Referenced by GetNextWorkRequired().

◆ GetBlockProof()

◆ GetBlockProofEquivalentTime()

int64_t GetBlockProofEquivalentTime ( const CBlockIndex to,
const CBlockIndex from,
const CBlockIndex tip,
const Consensus::Params  
)

Return the time it would take to redo the work difference between from and to, assuming the current hashrate corresponds to the difficulty at tip, in seconds.

Definition at line 272 of file pow.cpp.

Referenced by ConnectBlock(), and ProcessGetData().

◆ GetNextWorkRequired()

unsigned int GetNextWorkRequired ( const CBlockIndex pindexLast,
const CBlockHeader pblock,
const Consensus::Params params 
)

Definition at line 172 of file pow.cpp.

Referenced by ContextualCheckBlockHeader(), CreateNewBlock(), and UpdateTime().

◆ GetNextWorkRequiredBTC()

unsigned int GetNextWorkRequiredBTC ( const CBlockIndex pindexLast,
const CBlockHeader pblock,
const Consensus::Params params 
)

Definition at line 133 of file pow.cpp.

Referenced by GetNextWorkRequired().

◆ KimotoGravityWell()

unsigned static int KimotoGravityWell ( const CBlockIndex pindexLast,
const Consensus::Params params 
)
static

Definition at line 17 of file pow.cpp.

Referenced by GetNextWorkRequired().