Dash Core  0.12.2.1
P2P Digital Currency
pow.h File Reference
#include "consensus/params.h"
#include <stdint.h>

Go to the source code of this file.

Enumerations

enum  DiffMode { DIFF_DEFAULT = 0, DIFF_BTC = 1, DIFF_KGW = 2, DIFF_DGW = 3 }
 

Functions

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

Enumeration Type Documentation

◆ DiffMode

enum DiffMode
Enumerator
DIFF_DEFAULT 
DIFF_BTC 
DIFF_KGW 
DIFF_DGW 

Definition at line 19 of file pow.h.

Function Documentation

◆ CalculateNextWorkRequired()

unsigned int CalculateNextWorkRequired ( const CBlockIndex pindexLast,
int64_t  nFirstBlockTime,
const Consensus::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().

◆ 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  
)

Definition at line 172 of file pow.cpp.

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