#include <cstdint>
Go to the source code of this file.
|
arith_uint256 | CalculateASERT (const arith_uint256 &refTarget, const int64_t nPowTargetSpacing, const int64_t nTimeDiff, const int64_t nHeightDiff, const arith_uint256 &powLimit, const int64_t nHalfLife) noexcept |
|
uint32_t | GetNextASERTWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms) noexcept |
|
uint32_t | GetNextASERTWorkRequired (const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms, const CBlockIndex *pindexAnchorBlock) noexcept |
| Compute the next required proof of work using an absolutely scheduled exponentially weighted target (ASERT). More...
|
|
void | ResetASERTAnchorBlockCache () noexcept |
| ASERT caches a special block index for efficiency. More...
|
|
const CBlockIndex * | GetASERTAnchorBlockCache () noexcept |
|
◆ CalculateASERT()
arith_uint256 CalculateASERT |
( |
const arith_uint256 & |
refTarget, |
|
|
const int64_t |
nPowTargetSpacing, |
|
|
const int64_t |
nTimeDiff, |
|
|
const int64_t |
nHeightDiff, |
|
|
const arith_uint256 & |
powLimit, |
|
|
const int64_t |
nHalfLife |
|
) |
| |
|
noexcept |
◆ GetASERTAnchorBlockCache()
◆ GetNextASERTWorkRequired() [1/2]
◆ GetNextASERTWorkRequired() [2/2]
Compute the next required proof of work using an absolutely scheduled exponentially weighted target (ASERT).
With ASERT, we define an ideal schedule for block issuance (e.g. 1 block every 600 seconds), and we calculate the difficulty based on how far the most recent block's timestamp is ahead of or behind that schedule. We set our targets (difficulty) exponentially. For every [nHalfLife] seconds ahead of or behind schedule we get, we double or halve the difficulty.
Definition at line 108 of file aserti32d.cpp.
◆ ResetASERTAnchorBlockCache()
void ResetASERTAnchorBlockCache |
( |
| ) |
|
|
noexcept |
ASERT caches a special block index for efficiency.
If block indices are freed then this needs to be called to ensure no dangling pointer when a new block tree is created. (this is temporary and will be removed after the ASERT constants are fixed)
Definition at line 15 of file aserti32d.cpp.