Bitcoin ABC  0.29.2
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 
50  int64_t height, uint32_t old_nbits,
51  uint32_t new_nbits);
52 #endif // BITCOIN_POW_POW_H
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:23
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:26
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:74
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:91
bool PermittedDifficultyTransition(const Consensus::Params &params, int64_t height, uint32_t old_nbits, uint32_t new_nbits)
Return false if the proof-of-work requirement specified by new_nbits at a given height is not possibl...
Definition: pow.cpp:47
uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
Definition: pow.cpp:21
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
Parameters that influence chain consensus.
Definition: params.h:34