Bitcoin ABC  0.22.12
P2P Digital Currency
pow.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_POW_POW_H
7 #define BITCOIN_POW_POW_H
8 
9 #include <cstdint>
10 
11 struct BlockHash;
12 class CBlockHeader;
13 class CBlockIndex;
14 class CChainParams;
15 
16 namespace Consensus {
17 struct Params;
18 }
19 
20 uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev,
21  const CBlockHeader *pblock,
22  const CChainParams &chainParams);
23 
28 bool CheckProofOfWork(const BlockHash &hash, uint32_t nBits,
29  const Consensus::Params &params);
30 
31 #endif // BITCOIN_POW_POW_H
uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
Definition: pow.cpp:21
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Definition: chainparams.h:47
Parameters that influence chain consensus.
Definition: params.h:59
bool CheckProofOfWork(const BlockHash &hash, uint32_t nBits, const Consensus::Params &params)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition: pow.cpp:45
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: blockindex.h:23
const CChainParams & Params()
Return the currently selected parameters.
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:22