PIVX Core  5.6.99
P2P Digital Currency
pow.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin developers
3 // Copyright (c) 2014-2015 The Dash developers
4 // Copyright (c) 2017-2021 The PIVX Core developers
5 // Distributed under the MIT/X11 software license, see the accompanying
6 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
7 
8 #ifndef PIVX_POW_H
9 #define PIVX_POW_H
10 
11 #include <stdint.h>
12 
13 class CBlockHeader;
14 class CBlockIndex;
15 class uint256;
16 class arith_uint256;
17 
18 // Define difficulty retarget algorithms
19 enum DiffMode {
20  DIFF_DEFAULT = 0, // Default to invalid 0
21  DIFF_BTC = 1, // Retarget every x blocks (Bitcoin style)
22  DIFF_KGW = 2, // Retarget using Kimoto Gravity Well
23  DIFF_DGW = 3, // Retarget using Dark Gravity Wave v3
24 };
25 
26 unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader* pblock);
27 
29 bool CheckProofOfWork(uint256 hash, unsigned int nBits);
31 
32 #endif // PIVX_POW_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: chain.h:139
256-bit unsigned big integer.
256-bit opaque blob.
Definition: uint256.h:138
bool CheckProofOfWork(uint256 hash, unsigned int nBits)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
Definition: pow.cpp:122
arith_uint256 GetBlockProof(const CBlockIndex &block)
Definition: pow.cpp:141
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock)
Definition: pow.cpp:19
DiffMode
Definition: pow.h:19
@ DIFF_BTC
Definition: pow.h:21
@ DIFF_DGW
Definition: pow.h:23
@ DIFF_KGW
Definition: pow.h:22
@ DIFF_DEFAULT
Definition: pow.h:20