Dash Core  0.12.2.1
P2P Digital Currency
pow.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 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 <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 unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);
26 unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params&);
27 
28 
30 bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);
32 
34 int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params&);
35 
36 #endif // BITCOIN_POW_H
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &)
Definition: pow.cpp:172
DiffMode
Definition: pow.h:19
Definition: pow.h:23
Definition: pow.h:21
unsigned int CalculateNextWorkRequired(const CBlockIndex *pindexLast, int64_t nFirstBlockTime, const Consensus::Params &)
Definition: pow.cpp:204
arith_uint256 GetBlockProof(const CBlockIndex &block)
Definition: pow.cpp:257
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params &)
Definition: pow.cpp:238
int64_t GetBlockProofEquivalentTime(const CBlockIndex &to, const CBlockIndex &from, const CBlockIndex &tip, const Consensus::Params &)
Definition: pow.cpp:272
Definition: pow.h:22