Bitcoin ABC 0.30.7
P2P Digital Currency
grasberg.h
Go to the documentation of this file.
1// Copyright (c) 2020 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_POW_GRASBERG_H
6#define BITCOIN_POW_GRASBERG_H
7
8#include <cstdint>
9
10class CBlockHeader;
11class CBlockIndex;
12class CChainParams;
13
14uint32_t GetNextGrasbergWorkRequired(const CBlockIndex *pindexPrev,
15 const CBlockHeader *pblock,
16 const CChainParams &chainParams);
17
18namespace grasberg {
19
23int64_t computeTargetBlockTime(const CBlockIndex *pindexPrev,
24 const CChainParams &chainParams);
25
35uint32_t deterministicExp2(const uint32_t n);
36
37} // namespace grasberg
38
39#endif // BITCOIN_POW_GRASBERG_H
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:23
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:25
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:80
uint32_t GetNextGrasbergWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
Compute the next required proof of work using a relative target based ASERT algorithm.
Definition: grasberg.cpp:71
int64_t computeTargetBlockTime(const CBlockIndex *pindexPrev, const CChainParams &chainParams)
Compute the block time we are aiming for.
Definition: grasberg.cpp:108
uint32_t deterministicExp2(const uint32_t n)
Computes exp2(n) = 2^32 * (2^(n/2^32) - 1)
Definition: grasberg.cpp:140