Fabcoin Core  0.16.2
P2P Digital Currency
Functions
pow.cpp File Reference
#include <pow.h>
#include <arith_uint256.h>
#include <chain.h>
#include <chainparams.h>
#include <crypto/equihash.h>
#include <primitives/block.h>
#include <streams.h>
#include <uint256.h>
#include <util.h>
Include dependency graph for pow.cpp:

Go to the source code of this file.

Functions

unsigned int GetNextWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params &params)
 
unsigned int LwmaGetNextWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params &params)
 Zawy's LWMA - next generation algorithm. More...
 
unsigned int LwmaCalculateNextWorkRequired (const CBlockIndex *pindexPrev, const Consensus::Params &params)
 
unsigned int DigishieldGetNextWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params &params)
 Digishield v3 - used in Fabcoin mainnet currently. More...
 
unsigned int DigishieldCalculateNextWorkRequired (const CBlockIndex *pindexPrev, arith_uint256 bnAvg, int64_t nLastBlockTime, int64_t nFirstBlockTime, const Consensus::Params &params)
 
unsigned int ReduceDifficultyBy (const CBlockIndex *pindexPrev, int64_t multiplier, const Consensus::Params &params)
 Reduce the difficulty by a given multiplier. More...
 
bool CheckEquihashSolution (const CBlockHeader *pblock, const CChainParams &params)
 Check whether the Equihash solution in a block header is valid. More...
 
bool CheckProofOfWork (uint256 hash, unsigned int nBits, bool postfork, const Consensus::Params &params)
 Check whether a block hash satisfies the proof-of-work requirement specified by nBits. More...
 

Function Documentation

bool CheckEquihashSolution ( const CBlockHeader pblock,
const CChainParams params 
)

Check whether the Equihash solution in a block header is valid.

Definition at line 258 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 290 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int DigishieldCalculateNextWorkRequired ( const CBlockIndex pindexPrev,
arith_uint256  bnAvg,
int64_t  nLastBlockTime,
int64_t  nFirstBlockTime,
const Consensus::Params params 
)

Definition at line 218 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int DigishieldGetNextWorkRequired ( const CBlockIndex pindexPrev,
const CBlockHeader pblock,
const Consensus::Params params 
)

Digishield v3 - used in Fabcoin mainnet currently.

Definition at line 193 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 18 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int LwmaCalculateNextWorkRequired ( const CBlockIndex pindexPrev,
const Consensus::Params params 
)

Definition at line 96 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int LwmaGetNextWorkRequired ( const CBlockIndex pindexPrev,
const CBlockHeader pblock,
const Consensus::Params params 
)

Zawy's LWMA - next generation algorithm.

Definition at line 64 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int ReduceDifficultyBy ( const CBlockIndex pindexLast,
int64_t  multiplier,
const Consensus::Params params 
)

Reduce the difficulty by a given multiplier.

It doesn't check uint256 overflow!

Definition at line 242 of file pow.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: