Bitcoin ABC  0.22.13
P2P Digital Currency
Namespaces | Functions
daa.h File Reference
#include <cstdint>
Include dependency graph for daa.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Consensus
 

Functions

uint32_t GetNextDAAWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params &params)
 Compute the next required proof of work using a weighted average of the estimated hashrate per block. More...
 

Function Documentation

◆ GetNextDAAWorkRequired()

uint32_t GetNextDAAWorkRequired ( const CBlockIndex pindexPrev,
const CBlockHeader pblock,
const Consensus::Params params 
)

Compute the next required proof of work using a weighted average of the estimated hashrate per block.

Using a weighted average ensure that the timestamp parameter cancels out in most of the calculation - except for the timestamp of the first and last block. Because timestamps are the least trustworthy information we have as input, this ensures the algorithm is more resistant to malicious inputs.

Definition at line 91 of file daa.cpp.

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