Bitcoin Core 28.99.0
P2P Digital Currency
Functions
pow.h File Reference
#include <consensus/params.h>
#include <stdint.h>
Include dependency graph for pow.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 &)
 Check whether a block hash satisfies the proof-of-work requirement specified by nBits. More...
 
bool CheckProofOfWorkImpl (uint256 hash, unsigned int nBits, const Consensus::Params &)
 
bool PermittedDifficultyTransition (const Consensus::Params &params, int64_t height, uint32_t old_nbits, uint32_t new_nbits)
 Return false if the proof-of-work requirement specified by new_nbits at a given height is not possible, given the proof-of-work on the prior block as specified by old_nbits. More...
 

Function Documentation

◆ CalculateNextWorkRequired()

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

Definition at line 50 of file pow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 140 of file pow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckProofOfWorkImpl()

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

Definition at line 146 of file pow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNextWorkRequired()

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

Definition at line 14 of file pow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PermittedDifficultyTransition()

bool PermittedDifficultyTransition ( const Consensus::Params params,
int64_t  height,
uint32_t  old_nbits,
uint32_t  new_nbits 
)

Return false if the proof-of-work requirement specified by new_nbits at a given height is not possible, given the proof-of-work on the prior block as specified by old_nbits.

This function only checks that the new value is within a factor of 4 of the old value for blocks at the difficulty adjustment interval, and otherwise requires the values to be the same.

Always returns true on networks where min difficulty blocks are allowed, such as regtest/testnet.

Definition at line 89 of file pow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: