Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
pow.h
Go to the documentation of this file.
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-present 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_H
7
#define BITCOIN_POW_H
8
9
#include <
consensus/params.h
>
10
11
#include <cstdint>
12
13
class
CBlockHeader
;
14
class
CBlockIndex
;
15
class
uint256
;
16
class
arith_uint256
;
17
27
std::optional<arith_uint256>
DeriveTarget
(
unsigned
int
nBits,
uint256
pow_limit);
28
29
unsigned
int
GetNextWorkRequired
(
const
CBlockIndex
* pindexLast,
const
CBlockHeader
*pblock,
const
Consensus::Params
&);
30
unsigned
int
CalculateNextWorkRequired
(
const
CBlockIndex
* pindexLast, int64_t nFirstBlockTime,
const
Consensus::Params
&);
31
33
bool
CheckProofOfWork
(
uint256
hash,
unsigned
int
nBits,
const
Consensus::Params
&);
34
bool
CheckProofOfWorkImpl
(
uint256
hash,
unsigned
int
nBits,
const
Consensus::Params
&);
35
48
bool
PermittedDifficultyTransition
(
const
Consensus::Params
& params, int64_t height, uint32_t old_nbits, uint32_t new_nbits);
49
50
#endif
// BITCOIN_POW_H
CBlockHeader
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition
block.h:27
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition
chain.h:94
arith_uint256
256-bit unsigned big integer.
Definition
arith_uint256.h:231
uint256
256-bit opaque blob.
Definition
uint256.h:195
params.h
PermittedDifficultyTransition
bool PermittedDifficultyTransition(const Consensus::Params ¶ms, 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:89
GetNextWorkRequired
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &)
Definition
pow.cpp:14
CheckProofOfWork
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params &)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition
pow.cpp:140
CheckProofOfWorkImpl
bool CheckProofOfWorkImpl(uint256 hash, unsigned int nBits, const Consensus::Params &)
Definition
pow.cpp:161
CalculateNextWorkRequired
unsigned int CalculateNextWorkRequired(const CBlockIndex *pindexLast, int64_t nFirstBlockTime, const Consensus::Params &)
Definition
pow.cpp:50
DeriveTarget
std::optional< arith_uint256 > DeriveTarget(unsigned int nBits, uint256 pow_limit)
Convert nBits value to target.
Definition
pow.cpp:146
Consensus::Params
Parameters that influence chain consensus.
Definition
params.h:84
Generated on
for Bitcoin Core by
1.17.0